-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix resize-scroll when grid is not at top of page #1727
fix resize-scroll when grid is not at top of page #1727
Conversation
@Manfred-on-github did you test with latest 4.2.0 as I made some changes to scrollbar during thanks for doing this fix! |
have added a test page. Have checked error can be reproduced in 4.2.0, 4.0.3 and 3.3.0. |
thanks, that is perfect. |
funny you called it 'gridster' :) did you used that lib before ?? |
oh - yes, we used that originally, then, looking for something that is still maintained, we found gridstack. - Thank you for keeping this up. |
while this fixes the offset issue of the grid, still doesn't work perfectly as it scroll too soon... why does it scroll when we hit the white sidebar and not the actual end of the yellow grid ? |
for me it scrolls when the y-position of the pointer moves outside the range indicated by the white sidebar. This seems to be by design, as the function updateScrollResize() is invoked from gridstack-dd.ts with parameter distance as cellHeight, therefore (to visually show this in my sample) have explicitly set grid rowHeight to 130px, which is also used as border height in the sidebar. Of course this might be changed to some smaller value. For me it is also ok as it is now, as widgets further down will appear in view early before the resize just pushes them down, so user better sees what resizing of a particular widget will mean to positions of other widgets. Something that would rather improve user experience, is connected to the comment in that function about using a timer. As it is now, when pointer gets near the edge, this function scrolls the page, but then the pointer is still near the edge, so condition to scroll still holds, and the next scroll happens immediately, and so on. So something that limits these scroll events would definitely help here. |
yes about timer, and what #1576 is about (at least the speed part which I agree and needs to get done). | For me it is also ok as it is now, as widgets further down will appear in view early before the resize just pushes them down, so user better sees what resizing of a particular widget will mean to positions of other widgets. I can see that, but it's odd if you don't have widgets directly below to see what will happen on next block jump. Otherwise it's odd to scroll before you reach the edge. |
@Manfred-on-github looks like your change caused #1745 issue. I forced |
Description
when scroll element does not start from top of page, the scrolling during resize does not work as expected, the decision if to scroll, and amount to scroll, is computed wrong.
This PR fixes this.
Checklist
yarn test
)