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
Cannot unselect by clicking selected when using dataAdapter #6128
Comments
I can reproduce the behaviour that you're seeing, I'm trying to trace it down to a bug or something missing in the custom adapter. I upgraded your jsfiddle to use the latest release (4.1.0-beta) and the issue still exists. If I log the value of each result when it is displayed, I can see a few interesting things:
And when you try to unselect it
And if you try to select it again
|
Figured out the issue. The https://select2.org/data-sources/formats#automatic-string-casting I'm still leaving this open since Select2 should handle this case and automatically cast it, but it looks like something isn't consistently doing that which is causing issues. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
The project maintainer deliberately chose to leave this open, so it should be left open |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@kevin-brown I was taking a look into this separately, and arrived at the same conclusion that the cache lookups for item data fail, resulting in a missing At least for a small repro case, there's an alternative solution that doesn't rely on See: 8258567 Edit: update link to unbreak the commit hyperlink -- please note that it originated from a forked repository, though (not this repository) |
Sorry, ignore this attempt at a fix. I was testing it again using a hand-written Edit: update link to unbreak the commit hyperlink -- please note that it originated from a forked repository, though (not this repository) |
When using select2 with
dataAdapter
, the selected option cannot be deselected by clicking it again on list.If no
dataAdapter
option is used, it works fine, option can be deselected by clicking it second time.Here's example with a bug I described, you can select any option and then try to deselect it by clicking it again.
http://jsfiddle.net/o53fLqum/
The text was updated successfully, but these errors were encountered: