Open simeonpashley opened 6 years ago
Hi @simeonpashley - Thanks for reporting this issue. I released a possible fix in version 2.5.1-0. Please try it by installing react-cursor-position@2.5.1-0. In case you are interested, the branch with the changes is named issue24. Please let me know your findings. ~Ethan
Thanks, I'll give that a try.
FYI I'm using a component react-image-magnify
, which uses your component
Thank you for trying version 2.5.1-0. I appreciate it.
I had a look at react-image-magnify. It seems like it specifies version 2.4.1 of react-cursor-position. I'm wondering if you know why you have react-cursor-position@2.5.0
@simeonpashley - I am able to reproduce the issue you identified in Windows Edge. I think it is corrected in v3.0.0. Thanks again for bringing it to my attention. I appreciate it!
Anyone experiencing the "Unable to get property 'getCursorPosition' of undefined or null reference" issue in MS Edge, and also want the v2.x API, you can try v2.5.3.
@simeonpashley - Thanks again for opening this issue. I'm closing it as fixed in latest and v2.5.3. Please let me know if you don't think it has been corrected.
@ethanselzer Hi, I got this error from Sentry with v3.0.3
ReactCursorPosition.js:164 Uncaught TypeError: Cannot read property 'getCursorPosition' of undefined
at t.value (ReactCursorPosition.js:164)
Hi @kimsangw - Thanks for the information. Do you know if Sentry can provide details about the browser/OS? Also is there a high rate of this error?
@ethanselzer there isn't any details about the browser but the rate of error is low.
@kimsangw - Thanks for following up. I will investigate.
Hi @ethanselzer, sentry is sending at least one time per day this error. I was also thinking is was an IE-only bug, but the last report was for Chrome. Here is the details about the user:
Browser: Chrome 81.0.4044 browser.name: Chrome device: Mac device.family: Mac os: Mac OS X 10.11.6 os.name: Mac OS X url: https://teamstarter.co/
The code breaks here:
});
}
}, {
key: 'onClick',
value: function onClick(e) {
this.setPositionState(this.core.getCursorPosition(e)); <--- HERE
this.mouseActivation.mouseClicked();
this.onMouseDetected();
}
}, {
key: 'onTouchDetected',
When using v2.5.0, I see numerous entries in Sentry with the same error report. I haven't used previous versions so I don't know if this is a new issue.
Unable to get property 'getCursorPosition' of undefined or null reference
In the code excerpt below, it implies that
this.core
is null/undefinedAll the issues seem to be IE11 / Edge.... https://sentry.io/share/issue/b315166598af4d818172fd34cf2508db/ https://sentry.io/share/issue/4e135f3320604ae88d31a56f503906d7/ https://sentry.io/share/issue/b2a9bcd3f7144fe5b0f15cd1b5a2f81f/