Type=hidden single select with allowClear opens when clear button is pushed #386

Closed
wants to merge 3 commits into
from

Projects

None yet

2 participants

@slobo

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.

@ivaynberg

any chance for a jsfiddle that repros the issues with 3.2? ive been trying to find the time but couldnt yet.

@slobo

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/

@ivaynberg

wonder if we can use stopImmedatePropagation() instead of this flag. would be cleaner...

@slobo

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?

@slobo

btw, here it is with stopImmediatePropagation() (select2.js inlined) http://jsfiddle.net/rSatf/5/

@ivaynberg

i think i would rather see a killEventImmediately() helper and that used in the abbr

@slobo

Turns out e.stopImmediatePropagation() ie enough, and it's aready being used elsewhere so i didn't factor it out into separate function. 695279a

@slobo

Here's a demonstration with code from the new branch: http://jsfiddle.net/rSatf/6/

@ivaynberg ivaynberg closed this in 6690cc4 Sep 12, 2012
@slobo

@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/

@ivaynberg

how about now?

@slobo

Perfect, thanks for all the effort! http://jsfiddle.net/rSatf/8/

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