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

Invalid drag offset when page scrolled after 9.3 #2491

Closed
AdrienClairembault opened this issue Oct 3, 2023 · 10 comments
Closed

Invalid drag offset when page scrolled after 9.3 #2491

AdrienClairembault opened this issue Oct 3, 2023 · 10 comments

Comments

@AdrienClairembault
Copy link

AdrienClairembault commented Oct 3, 2023

Subject of the issue

Trying to move widgets while the page is scrolled down lead to unexpected behavior.
It seems there is a noticeable vertical offset between the mouse position and the widget position, which get worse the lower you scroll down the page.
While at the top of the page (no scroll), there is no issue.

Example:

gridstack

Your environment

Official demo: https://gridstackjs.com/demo/
Latest release is 9.3.0 at this date, which I suppose the demo is using.

Steps to reproduce

  • Open https://gridstackjs.com/demo/float.html
  • Move or expand the existing widget toward the bottom of the page to expand the available height as much as possible
  • Add another widget
  • Move the new widget around while the page is not scrolled, which should work as expected without issues
  • As soon as you start scrolling down the page, moving the widget around no longer work as expected (there is a noticeable vertical offset between the mouse position and the widget position).
@AdrienClairembault
Copy link
Author

AdrienClairembault commented Oct 3, 2023

Possibly related to changes in b559a6f ?

@adumesny
Copy link
Member

adumesny commented Oct 3, 2023

@VincentMolinie can you please take a look. yeah scrolled content is something I didn't try before...

@VincentMolinie
Copy link
Contributor

I do reproduce, I will try to check what's going on

@adumesny
Copy link
Member

adumesny commented Oct 9, 2023

great thank you, as I was going to revert your changes until we have time to fix it otherwise. It's holding other changes I need for work and depend on scroll so can't use 9.3.0 right now

@VincentMolinie
Copy link
Contributor

VincentMolinie commented Oct 11, 2023

Okey I think I got the fix, I'll create a PR

@VincentMolinie
Copy link
Contributor

VincentMolinie commented Oct 11, 2023

And the fix is here: #2499
@AdrienClairembault can you let me know if it fixes your issue 🙏

@AdrienClairembault
Copy link
Author

I confirm that the fix is effective and solve the issue.
Thanks @VincentMolinie

@Jenny3107
Copy link

Jenny3107 commented Oct 11, 2023

Hello,
For my part, the problem is still present on my website and can be seen on the "Advanced Demo" example. To reproduce, I just set the page height (html tag) to 2000px.
image

@adumesny
Copy link
Member

@Jenny3107 you manually pulled Vincent fix and tried that ? I'm not sure it's the right fix anyway, but away this week so limited access to work on this.

@Jenny3107
Copy link

No indeed sorry, I thought it had been put on the "master" branch, I just redid an "npm install" thinking the fix had been added. I tried directly on the site: https://gridstackjs.com/demo/web2.html
No worries, I'll wait, thanks.

@adumesny adumesny changed the title Invalid drag offset when page is scrolled down Invalid drag offset when page scrolled after 9.3 Oct 11, 2023
adumesny added a commit to adumesny/gridstack.js that referenced this issue Oct 15, 2023
adumesny added a commit to adumesny/gridstack.js that referenced this issue Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants