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

SyntaxError in IE11 #144

Closed
kaelig opened this issue Jan 19, 2017 · 3 comments · Fixed by #149
Closed

SyntaxError in IE11 #144

kaelig opened this issue Jan 19, 2017 · 3 comments · Fixed by #149

Comments

@kaelig
Copy link
Contributor

kaelig commented Jan 19, 2017

I haven't tested in IE10 but it might occur there as well.

Steps to reproduce:

  1. Focus an autocomplete field
  2. Exit the field (click or tab away)
  3. IE11 throws a SyntaxError

The issue comes from this code block: https://github.com/algolia/autocomplete.js/blob/4d5910a2a3f8677f1562754ed5cbe220abb0bea0/src/autocomplete/typeahead.js#L62

Workaround

This is a temporary fix I've applied in my branch - but this might break other versions of IE.

- if (_.isMsie() && ($menu.is(active) || $menu.has(active).length > 0)) {
+ if (_.isMsie()  && _.isMsie() < 11 && ($menu.is(active) || $menu.has(active).length > 0)) {
@vvo
Copy link
Contributor

vvo commented Jan 20, 2017

I am not able to reproduce the issue with the repo examples, could you create a small jsFiddle or use the repo yarn dev command to try to reproduce it?

What is the thrown Syntax Error?

@kaelig
Copy link
Contributor Author

kaelig commented Jan 20, 2017

Unfortunately syntax error is... "SyntaxError".

It happens in playground.html, in the standalone version (I should have mentioned that, sorry). But it's also reproducible in a DocSearch implementation, e.g. on www.lightningdesignsystem.com

vvo pushed a commit that referenced this issue Jan 23, 2017
Zepto's .is only support selectors, not dom nodes: http://zeptojs.com/#is
DOMElement.contains() works on all browsers (IE5).

fixes #144
@vvo
Copy link
Contributor

vvo commented Jan 23, 2017

Ok I have a fix see #149

@vvo vvo closed this as completed in #149 Jan 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants