IE9 Clicking an item doesn't hide the menu
When I click an item to select it from the select dropdown, the item gets shown as selected, however the menu does not go away. It initially does, but pops back up right away. This can be seen with IE9 when going to the main example page: http://brianreavis.github.io/selectize.js/
Thanks.
This is also in issue in IE10. Clicking somewhere else on the page makes the menu go away. I'll look into this!
Well, I think I've found the problem. I just changed this:
// restore focus to input
if (this.isFocused) {
window.setTimeout(function() {
if (inputMode === 'single') {
self.blur();
self.focus(false);
self.hideInput();
} else {
self.focus(false);
}
}, 0);
}
to this:
// restore focus to input
if (this.isFocused) {
window.setTimeout(function() {
if (inputMode === 'single') {
self.focus(false);
-------------> self.blur(); <-------------
self.hideInput();
} else {
self.focus(false);
}
}, 0);
}
And then it started working on IE! Did I do something wrong? Is this change correct?
That would fix this problem, but would break #3. There seem to be some more widespread focus problems with IE8. Trying to track it down now!
Postmortem: In WebKit browsers events are triggered inline and in IE they're deferred. The deferred events caused problems with the ignoreFocus flag that allows focus to be given without having the handlers to be triggered.
Well, it worked, but I've found a problem using IE9 to test: the blur is not happening :(
To make it happen, use the following steps:
- Click in select
- Select an option
- Try to click in select again (it will not expand).
If I click outside and then click in select again, everything works.
Ahh crap. IE. Back to the drawing boards :) Thanks for reporting.
This should be resolved once and for all, I hope—I tested IE 8, 9, and 10. If anyone notices anything, please let me know.