GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
This is inconsistent with how based single select works. This patch makes hidden input based single select behave in the same way - selection is only cleared and we don't open the select for searching.
Do not open type='hidden' single select when clearing the choice
any chance for a jsfiddle that repros the issues with 3.2? ive been trying to find the time but couldnt yet.
It's a problem with jQuery 1.6 (1.7 and 1.8 seem to work fine): http://jsfiddle.net/rSatf/1/
Here it is running with my patch and jQ1.6: http://jsfiddle.net/rSatf/2/
wonder if we can use stopImmedatePropagation() instead of this flag. would be cleaner...
Yes, the flag is ugly. stopImmediatePropagation() works. I can make a patch that puts it in killEvent() function, or do you want to localize it to "abbr" mousedown?
btw, here it is with stopImmediatePropagation() (select2.js inlined) http://jsfiddle.net/rSatf/5/
i think i would rather see a killEventImmediately() helper and that used in the abbr
Revert "Do not open type='hidden' single select when clearing the cho…
This reverts commit 65d5bb0.
Merge branch 'master' of git://github.com/ivaynberg/select2
Turns out e.stopImmediatePropagation() ie enough, and it's aready being used elsewhere so i didn't factor it out into separate function. 695279a
Here's a demonstration with code from the new branch: http://jsfiddle.net/rSatf/6/
@ivaynberg you need to move the event binding for attr above general mousedown for it to work in jQ1.6. There is still the problem http://jsfiddle.net/rSatf/7/
bind abbr handler before mousedown. fixes #386
how about now?
Perfect, thanks for all the effort! http://jsfiddle.net/rSatf/8/