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

Unable to get property 'modal' of undefined or null reference #21

Open
axelson opened this issue Mar 3, 2017 · 1 comment
Open

Unable to get property 'modal' of undefined or null reference #21

axelson opened this issue Mar 3, 2017 · 1 comment

Comments

@axelson
Copy link
Contributor

axelson commented Mar 3, 2017

Via honey-badger I am getting a "Unable to get property 'modal' of undefined or null reference". It seems to only happen on windows phones. Here is the stacktrace that it gives:

webpack:///./~/simple-react-modal/build/simple-modal.js:59:0:in `this'
57     key: 'hideOnOuterClick',
58     value: function hideOnOuterClick(event) {
59       if (this.props.closeOnOuterClick === false) return;
60       if (event.target.dataset.modal && this.props.onClose instanceof Function) this.props.onClose(event);
61     }

This is the UA string I have: "Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 920)"

I believe the problem is that the event.target.dataset property was only added in IE11 whereas this browser is running IE10. Can this be worked around in the code? I don't have a windows phone on me so I'm not sure how big of a problem this is causing my users.

@richseviora
Copy link

I have a similar issue where users clicking on an SVG element will trigger this in browsers w/o support for SVGElement#dataset. Recommend that it be changed to (event.target.dataset && event.target.dataset.modal && ...)

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

2 participants