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

When I use the layout horizontal option with the dragAutoScroll property, infinite scrolling occurs horizontally when attempting to drag. #539

Closed
jiniC opened this issue Dec 21, 2022 · 2 comments

Comments

@jiniC
Copy link

jiniC commented Dec 21, 2022

Hello! I have posted many questions in the past, and I was very grateful for your quick and kind response. It's late, but I'd like to think about the issue(#509) with you if I have time. 🧐

But before that, I'm leaving a question because I'm having a problem during another test. I used the layout horizontal option because I want a horizontal scroll. Also, I used the dragAutoScroll property because I wanted the horizontal scroll to work automatically when dragging. However, if I set the targets attribute value to window, horizontal scroll works, but there is a problem that the scroll moves indefinitely as shown in the video below. How can I solve this situation?

horizontal.scroll.error.mp4

The link below is the code being tested.
https://codepen.io/jiniC/pen/VwBYyva

Just in case, I tested the .drag-container with the same right value as the width value of the murri area, but it also failed. 😢

@jiniC
Copy link
Author

jiniC commented Dec 21, 2022

I omitted adding dragContainer property when creating the second Murri object. It was confirmed that it worked well.
It's the best library ever! 👍

@jiniC jiniC closed this as completed Dec 21, 2022
@niklasramo
Copy link
Collaborator

@jiniC Glad yot got this sorted out on your own :) But yeah, the issue is that the dragged element will extend the scroll area of the window when you drag it past it's boundaries and there's no easy way for Muuri to automatically prevent that. So the simplest way to fix that is indeed use a drag container that contains the dragged element and preventing it from extending the window's scroll area.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants