Cannot scroll to last item if has many items
See original GitHub issuefirst, thanks for you library it’s very helpful for my work.
I have some issue when the container has lot of items. ( Ex. 50 items with 150px of width)
I look in the element inspector
this code
transform: translate3d(-1805.47%, 0px, 0px)
I guess it’s always back to -1800%
how to increase?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Cannot scroll to last element in content container tailwindcss
I have got the structure almost working but I cannot scroll to the bottom of the content container. I want everything else to...
Read more >List Box - not able to scroll to last item | MrExcel Message Board
I have a list box that I'm filling dynamically (depends on the file being opened, there could be 1 item and there could...
Read more >Scroll to Bottom of List in iOS 16… | Apple Developer Forums
I'm trying to add an item to the bottom of a List and then scroll that added item into view. I've made the...
Read more >Element size and scrolling - The Modern JavaScript Tutorial
Properties scrollLeft/scrollTop are the width/height of the hidden, scrolled out part of the element. On the picture below we can see ...
Read more >overscroll-behavior - CSS: Cascading Style Sheets | MDN
If you have overscroll-behavior: contain; selected, the outer container will not scroll unless you move your cursor out of the inner container ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello again @khanitnanj,
Thank you for the CodeSandbox, it helped me debug why you’re experiencing this issue 👍.
Please use padding instead of margin for spacing between slides, like the Basic Setup CodeSandbox on the embla-carousel-react readme shows.
Embla won’t take the slide margins into account when reading the slide widths, which is why you can’t reach the last slide because the margins of 50 slides will stack up. But the padding will be included when reading the slide widths. This of course, assuming that you’re using the
box-sizing: border-box;
property as default like so:Read more about why you would want to use the
border-box
as default in this article and on this StackOverflow question.Let me know if this helps!
Cheers David
Hi again @khanitnanj,
For what it’s worth, Embla Carousel now supports margin and any other means that will render spacing between your slides. You’re not forced to use the padding approach anymore. And it will automatically detect your spacings!
This feature was released with version 4.2.0. Read more about it here if you’re interested.
Kindly, David