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

Incorrect position after mouse-wheel scroll #22

Closed
aronhelser opened this issue Mar 6, 2018 · 7 comments
Closed

Incorrect position after mouse-wheel scroll #22

aronhelser opened this issue Mar 6, 2018 · 7 comments

Comments

@aronhelser
Copy link

I'm seeing some incorrect y-positions after I scroll using my mouse wheel - the cursor remains inside the component. If I scroll by dragging the scroll bar, it's correct.

ReactCursorPosition and the component it's wrapping are inside a div with overfow-y: auto.

I'm happy to provide more detail if needed.

@ethanselzer
Copy link
Owner

@aronhelser - Thanks for opening this issue. I'm wondering if the incorrect y-position you are experiencing persists after moving the mouse or only before the mouse is moved. Please let me know.

@aronhelser
Copy link
Author

aronhelser commented Mar 16, 2018 via email

@aronhelser
Copy link
Author

@ethanselzer I had a chance to illustrate the problem, thanks for providing a playground pen!

https://codepen.io/ahelser/pen/JvPwPR

If you mouse-wheel scroll, the position is reported as if it's unscrolled. But if you exit and re-enter, the position is corrected.

Looking though your very clean and modular code, I see that you don't listen to scroll events at all. Seems like that would be necessary to fix this problem?

@ethanselzer
Copy link
Owner

Hi @aronhelser - Thanks for creating a reduced test case. That is very helpful. I'm working on an improvement that may correct the issue you have identified. I will post here when it is released.

@ethanselzer
Copy link
Owner

Hi @aronhelser - The latest release of react-cursor-position introduces the reset method, which may correct the problem you identified in this issue. Please see the demo example for details. Thanks again for opening this issue. I appreciate it.

@ethanselzer
Copy link
Owner

@aronhelser - I'm closing this issue for now. If you find your use case is not corrected by v2.5.0, please reopen the issue. Thanks!

@aronhelser
Copy link
Author

aronhelser commented Jul 31, 2018 via email

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