Skip to content

🐛 unable to clear selected options in UI #321

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
tpeacock19 opened this issue Mar 25, 2025 · 0 comments
Open

🐛 unable to clear selected options in UI #321

tpeacock19 opened this issue Mar 25, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@tpeacock19
Copy link

Bug Description

Hello,

I'm attempting to clear the selected options for a field using $('#id_field').val(null).trigger('change') as directed in the select2 docs. However, when I do, the options are never removed from the UI. Is this expected behavior?

Thanks!

Steps to Reproduce

attempt to clear a django-select2 field with $('#id_field').val(null).trigger('change') via browser console.

Expected Behavior

all options are removed from UI and select2 state.

@tpeacock19 tpeacock19 added the bug Something isn't working label Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants