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
The <option> that was just selected does not seem to be available when listening to the select2:select event. In the select2:unselecting and select2:unselect events, the unselected <option> is available through e.params.args.data.element/e.params.data.element. I do not see a reason why the <option> should not be available in the select2:select event, since it is created at this time. For the select2:selecting event, however, the <option> is not yet created, and obviously cannot be available when the event is fired.
The text was updated successfully, but these errors were encountered:
Looks like a bug to me:
when using a select2 with the multiple option, event.params.data as well as event.params.currentTarget retain the last option selected before this selection, not the option that triggered this event.
It's possible that #5058 (released in 4.0.6-rc.0) has fixed this. Would be helpful if everyone could try out the pre-release and see if it resolves this behavior!
I just made a CodePen to test. But I can't seem to reproduce the issue now. Not even in version 4.0.2, which was the most recent version when this issue was created. In the CodePen everything seems to be working. Can you have a look, @cigaar? Maybe I've forgotten and misunderstood the original issue completely.
The
<option>
that was just selected does not seem to be available when listening to theselect2:select
event. In theselect2:unselecting
andselect2:unselect
events, the unselected<option>
is available throughe.params.args.data.element
/e.params.data.element
. I do not see a reason why the<option>
should not be available in theselect2:select
event, since it is created at this time. For theselect2:selecting
event, however, the<option>
is not yet created, and obviously cannot be available when the event is fired.The text was updated successfully, but these errors were encountered: