Skip to content
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

IE11 bugfix causes issues with tab order #877

Closed
sb-relaxt-at opened this issue Aug 11, 2015 · 8 comments
Closed

IE11 bugfix causes issues with tab order #877

sb-relaxt-at opened this issue Aug 11, 2015 · 8 comments

Comments

@sb-relaxt-at
Copy link

In IE 11.0 tabbing through Selectize fields is broken, try this example, focus the first field and then press tab. It should now focus the second selectize (note that there are even added tabindex properties).

The reason seems to be the bugfix for "IE11 bug: element still marked as active" in onBlur:

(dest || document.body).focus();

This causes the document's body to be focused. Removing this line resolves the issue (see this fiddle), but I am not aware about the reason why this line has been added (and what issue it is trying to fix).

@jods4
Copy link

jods4 commented Nov 3, 2015

This "bugfix" does indeed create a bug which prevent proper keyboard navigation in IE11.
Removing the lines makes tab navigation work.

BUT it breaks "activate/focus" management in IE11. I noticed without this line that if you click in another textbox when selectize has focus, although the textbox seems focused the proper "activate/focus" events are not raised, which can cause problems, e.g. if your target textbox hosts a JS date picker.

So I'm looking for something that would fix both issues!

@jods4
Copy link

jods4 commented Nov 3, 2015

#406 seems to be the reason why this line of code is here.

@jods4
Copy link

jods4 commented Nov 3, 2015

OK I fixed it by changing this line:

(dest || document.body).focus();

to:

dest && dest.focus();

i.e. I'm only focusing the next control if I know one (which fixes the "no activate/focus on click" issue and let it go otherwise (which fixes tab navigation).

As far as I can tell it works nicely. Because I don't fully grasp what was creating the original problem (broken keyboard navigation), I can't say I'm 100% confident this change doesn't have adverse side-effects.

@sb-relaxt-at
Copy link
Author

Thanks for your efforts. I will try this modified solution in our current usage scenario.

@brownbl1
Copy link

I've also tried this proposed fix and it has solved our IE bug as well, FWIW. I haven't done thorough testing though.

@bwilson-ux
Copy link
Contributor

Perfect resolution - current project I am working on requires numerous instances of the selectize menu. This proposed fix works very well. 👍

bwilson-ux added a commit to bwilson-ux/selectize.js that referenced this issue Feb 2, 2016
@sb-relaxt-at
Copy link
Author

Just realized that I had patched it that way back in August. From my point of view it is working fine too.

@joallard
Copy link
Member

Closed by #997, thanks all

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

No branches or pull requests

5 participants