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

"'documentMode' in document" check giving inconsistent results #7583

Closed
SchleyB opened this issue Aug 26, 2016 · 3 comments
Closed

"'documentMode' in document" check giving inconsistent results #7583

SchleyB opened this issue Aug 26, 2016 · 3 comments

Comments

@SchleyB
Copy link

SchleyB commented Aug 26, 2016

Bug

What is the current behavior?

Line 124 of ChangeEventPlugin.js

isInputEventSupported = isEventSupported('input') && (!('documentMode' in document) || document.documentMode > 11);

Is incorrectly returning false in non-IE browsers when paired with some 3rd party code, specifically

!('documentMode' in document)

Is returning false because Google Tag Manager in this case is setting document.documentMode to undefined. This is causing these errors on input fields

Uncaught TypeError: activeElement.detachEvent is not a function
TypeError·Uncaught TypeError: Cannot delete property 'value' of #<HTMLInputElement>

A better check in this case might be

!document.documentMode

As this would still accomplish the intended check while minimizing conflicts with other codebases

I have found a couple of other instances of this issue:
#7421
#5920

*Which versions of React, and which browser / OS are affected by this issue? *

Chrome 52
React 15.3.1

@gaearon
Copy link
Collaborator

gaearon commented Aug 27, 2016

Would you like to send a PR?

@SchleyB
Copy link
Author

SchleyB commented Aug 28, 2016

Sure thing...7594

@zpao
Copy link
Member

zpao commented Aug 29, 2016

That's merged so we can close this out. Thanks!

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

No branches or pull requests

3 participants