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

Enforce node != document checks #322

Merged
merged 1 commit into from
Feb 18, 2017
Merged

Conversation

lPadier
Copy link
Contributor

@lPadier lPadier commented Feb 7, 2017

Check that node is not document nor null on first iteration.

Check that node is not document nor null on first iteration.
@moroshko
Copy link
Owner

moroshko commented Feb 7, 2017

Could you explain the problem you are trying to solve?

@lPadier
Copy link
Contributor Author

lPadier commented Feb 10, 2017

In the app I'm building, node.getAttribute('data-suggestion-index') sometimes fails on IE 11 with the following error message:

object does not support property or method getAttribute

Checking that node !== document or null before the first loop iteration should avoid event.target being document.

@moroshko
Copy link
Owner

Thanks!
Did you test that this change solves the issue in IE11?

@lPadier
Copy link
Contributor Author

lPadier commented Feb 17, 2017

Dispatching a mousedown event on document with this change no longer throws an error on IE11.

@moroshko moroshko merged commit a34cbc2 into moroshko:master Feb 18, 2017
@moroshko
Copy link
Owner

v8.0.1 contains this fix. Thanks!

@Degee
Copy link

Degee commented Nov 1, 2017

Actually i am getting exactly the same error with version 9.3.2 of autosuggest

object does not support property or method getAttribute

I think this was not really a solution. Weird thing is that error sometimes randomly dissappears.

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 this pull request may close these issues.

None yet

3 participants