selectize.js icon indicating copy to clipboard operation
selectize.js copied to clipboard

IE9 not firing focus event on input after selectize

Open marijo-knez opened this issue 12 years ago • 8 comments

http://jsfiddle.net/aBkgs/13/

So I have a selectize with some options and an input next to it. When I select a value form the selectize (or just focus on the control) and then click on the input the focus event of the input does not fire in IE9. It works in Chrome. If I click one more time on the input then the event fires.

For jsfiddle to work in IE9 follow this link. http://stackoverflow.com/questions/15260947/why-jsfiddle-is-not-rendering-at-all-in-ie8-and-previous-versions

Can anybody help? Am I missing something?

marijo-knez avatar Jan 02 '14 21:01 marijo-knez

I am experiencing the same thing. Because of this, placeholder text in non-selectized controls are being treated as content upon initial focus.

dtsmax avatar Jan 28 '14 22:01 dtsmax

Maybe it is not the best solution but it works for us. We fired the focus event of the focused control again, when onblurr fires on the selectize control. To do this we had to know which control we need to focus, so we added this code at the begining of selectize.js:

var IE = document.all ? true : false; document.onmousemove = getMouseXY; var tempX = 0; var tempY = 0; function getMouseXY(e) { if (IE) { // grab the x-y pos.s if browser is IE tempX = event.clientX + ((document.body != undefined) ? document.body.scrollLeft : 0) tempY = event.clientY + ((document.body != undefined) ? document.body.scrollTop : 0) } };

and then at the end of the onblur, after self.refreshState(); we added if (IE) { var elem = document.elementFromPoint(tempX, tempY); $(elem).focus(); } Hope it helps.

If anybody has a better solution please post.

marijo-knez avatar Feb 03 '14 07:02 marijo-knez

We have the same issue and can replicate on IE10 and IE11

scott-laursen avatar Feb 13 '14 14:02 scott-laursen

Is there a workaround for this, apart from what is suggested above by marijoT9?

chennakrishnaa avatar Mar 21 '14 13:03 chennakrishnaa

Upon investigation, it is found where is the problem but I am not sure on the solution.

It is in the line #644 which is causing this issue. if we remove this it is working fine.

chennakrishnaa avatar Mar 21 '14 17:03 chennakrishnaa

line #644 in what file?

ghost avatar Jun 11 '14 17:06 ghost

Which lines? I have the same problem..

h0jeZvgoxFepBQ2C avatar Sep 30 '14 15:09 h0jeZvgoxFepBQ2C

closing stale issues older than one year. If this issue was closed in error please message the maintainers. All issues must include a proper title, description, and examples.

risadams avatar Nov 11 '20 17:11 risadams