Closed aminy closed 6 years ago
Hi @aminy - Thanks for opening this issue. What you report sounds good, but I'm having trouble reproducing the issue. I created an example of rendering an instance of react-cursor-position in response to a button click event, but In my case react-cursor-position becomes active without needing to re-enter the mouse cursor. Please see my example and let me know what I'm missing. Thanks!
@aminy - I'm closing this for now due to lack of activity. Please let me know if you have any further thoughts. Thanks!
We've experienced this issue, when clicking on a button renders a ReactCursorPosition component, but the cursor is already inside the new component.
In this case, the init() function will not be called until the mouse exits and entered the component again.
An easy fix for this is to call init() function in onComponentDidMount.
I will include a PR to fix this issue.