Skip to content
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

Make the selected <option> available in the select2:select event #4371

Closed
Stadly opened this issue May 21, 2016 · 4 comments
Closed

Make the selected <option> available in the select2:select event #4371

Stadly opened this issue May 21, 2016 · 4 comments

Comments

@Stadly
Copy link

Stadly commented May 21, 2016

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.

@cigaar
Copy link

cigaar commented May 31, 2016

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.

@Stadly
Copy link
Author

Stadly commented Sep 30, 2016

Any news on this?

@alexweissman
Copy link
Contributor

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!

@Stadly
Copy link
Author

Stadly commented Oct 28, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants