Skip to content

🐛 unable to clear selected options in UI #321

Closed

Description

@tpeacock19

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.

Activity

  1. Repository owner locked and limited conversation to collaborators on May 4, 2025
  2. converted this issue into a discussion #323 on May 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions