You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I change the [value] of a select2 with the "multiple" attribute turned on, options in the new value that were not previously selected become selected, but all options that were previously selected also remain selected -- so my selection is the union of the old values and the new values, rather than just being the new values.
This also means that if I pass an empty array to [value], nothing changes, whereas I would expect all options to be un-selected.
I believe the issue is in setElementValue(), the innermost if needs an else to turn the selected property off when the option is not contained in the new value, like so:
When I change the
[value]
of a select2 with the "multiple" attribute turned on, options in the new value that were not previously selected become selected, but all options that were previously selected also remain selected -- so my selection is the union of the old values and the new values, rather than just being the new values.This also means that if I pass an empty array to
[value]
, nothing changes, whereas I would expect all options to be un-selected.I believe the issue is in setElementValue(), the innermost
if
needs anelse
to turn the selected property off when the option is not contained in the new value, like so:The text was updated successfully, but these errors were encountered: