-
-
Notifications
You must be signed in to change notification settings - Fork 188
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
Unnecessary scroll under certain conditions #46
Comments
Hi Oleg (@olushchik), Nice catch, and thank you for reporting this! I appreciate the clear CodeSandbox demonstration ⭐️. As you mention, Embla acts on the focus event and wants to scroll to the snap index containing the focused element (in this case index Right now I'm working on the Best, |
Hi, David! Thanks for the response!
Oh, now I understand for what reasons this was done 😃 But I'm not sure that I understand how to fix it properly 😢 |
Hello Oleg (@olushchik), No worries 🙂. This issue will have to wait then. I appreciate you taking time to report this! Kindly, |
Hello Oleg (@olushchik), The following commit includes a fix for this bug. Embla Carousel Version 3 is just around the corner so the bug fix will be released with version 3. Thanks for taking time to create this issue 👍! Best, This bug has been fixed and will be released with version 3. |
Thanks a lot, you are the best! |
Hello @olushchik, This bug has been fixed and is ready for test if you grab the latest version. Note that it's a major version release so please read the instructions here. I would very much appreciate if you could confirm if this is working as expected now and the bug has been solved. |
Have you had the chance to test this @olushchik? Thanks in advance. |
Unfortunately, no. Just tested in sandbox, works fine. |
@olushchik so this issue is resolved then 🙂? |
I reread my message and realized that it was not clear)) I meant that I did not check this in my real project, but only in the sandbox. And looks like the issue is resolved 👍 |
Awesome, thank you for your feedback. I'm closing this issue and thanks for reporting this 👍. |
Hi! I ran into a nasty bug with unnecessary scroll under certain conditions:
loop
:true
draggable
:false
slidesToScroll
: more than 1 (for example 4)slidesToScroll
but not completely divisible byslidesToScroll
(for example 5)In this case after initial load when we scroll to next and try to click link on the first slide we see unnecessary scroll.
Here's a demonstration of what I'm talking about: https://codesandbox.io/s/embla-carousel-containscroll-mec6x
As I figured out it is because click on the link fires
focus
event and Embla considers that this is not the current slide and does scroll.The text was updated successfully, but these errors were encountered: