react-rnd
react-rnd copied to clipboard
[BUG] Incorrect top border in window mode
It's a bug.
Overview of the problem
I'm using react-rnd 10.1.10* [x.x.x]
My browser is: Chrome / Firefox
Reproduced project
https://github.com/altro3/window-bug
In sandbox: https://codesandbox.io/s/tender-lovelace-6rhff
Description
Problem with top window bound, when I scroll down page. If I view midlle or bottom page, top border of draggable window is changing and I can't move it to upper corners.
Steps to Reproduce
- You can try to move draggable element - it works perfectly
- Scroll down to middle or to bottom of the page
- Try to move draggable element to top border
Expected behavior
The dragged element should move to the top of the browser with any scroll position.
Actual behavior
The dragged element can't move to the top of the browser, if page scrolled, because was mistake in calculations of top border coordinates