Skip to content

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

@SchleyB

Description

@SchleyB

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions