FWIW the post was about getting excited about a new API only to be disappointed.
I haven't experienced the issues you are having in Windows 10 Edge. The carousel animates in fine for me. Testing in Ubuntu 18.04 theres definitely some issues with vertical scrollbars that overflow-y: hidden fixes.
My carousel is embedded in an infini-loading feed page, so vertical scrolling is an issue with that method.
<...short break for checking stuff....>
Sooooo.... I just tested Firefox on Ubuntu and it behaves the exact same way as Firefox on Windows and Mac OS X as well. It works. Kinda. So the horizontal scroll that brings the image into view does work there, but overall the carousel also scrolls to the top of the view port.
Out of curiosity I tested the latest Google Chrome on my old Mac Mini again. And lo and behold: Google Chrome is broken across Linux and Mac OS X (haven't tested Windows yet). scrollIntoView does not work anymore as expected. Well... it does scroll the entire carousel to the top of the view port, but the image is not brought into view. Looks like Google messed up something recently 😔
The carousel being full screen makes no difference. If there is overflow of the container, vertical scrollbar will appear. There can still be issues with vertical scrollbars showing up in Ubuntu in particular without any apparent overflow.
I haven't seen this same issue with "the carousel also scrolls to the top of the view port." I've been testing in Chrome Canary with good results.
Ok, I just figured out what my issue is. I'm an idiot who doesn't read the documentation.
I ignored the options arguments inline and block so far. When I implemented my carousel on Mac OS X a couple months ago I only specified 'behavior': 'smooth' and skipped the other two properties. It gave me perfect results back then, and that seems to have changed recently (change of default values?).
Adding the two missing properties fixes the problem though. I get consistent results and scroll behavior in Firefox and Chrome and on both Linux and Mac:
Ugh... Sorry for having been such a Debbie Downer here. On the other hand that little conversation with you made me actually look a bit harder and fix the problem in the end. I was about to roll my own scrollIntoView implementation because it looked totally broken to me.
So well... yay, scrollIntoView is actually awesome 😄
For anyone else coming by: please ignore this thread
I used {block: "nearest"} instead of {block: "center"}. It prevents the vertical scroll.
I also developed a horizontal scroll-carousel. And it works really fine!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
FWIW the post was about getting excited about a new API only to be disappointed.
I haven't experienced the issues you are having in Windows 10 Edge. The carousel animates in fine for me. Testing in Ubuntu 18.04 theres definitely some issues with vertical scrollbars that
overflow-y: hidden
fixes.Here is my SCSS if it helps.
A tip for iOS Safari.
You can set the look and feel of the scrollbar in Windows 10 to react similar to MacOS, where it autohides.
This carousel is styled for a full page takeover, so set width and height to fit your container.
Hmm... So the main difference in your case is that your carousel is full screen, which rules out vertical scrolling.
My CSS rules for the container are not too far off from yours:
My carousel is embedded in an infini-loading feed page, so vertical scrolling is an issue with that method.
<...short break for checking stuff....>
Sooooo.... I just tested Firefox on Ubuntu and it behaves the exact same way as Firefox on Windows and Mac OS X as well. It works. Kinda. So the horizontal scroll that brings the image into view does work there, but overall the carousel also scrolls to the top of the view port.
Out of curiosity I tested the latest Google Chrome on my old Mac Mini again. And lo and behold: Google Chrome is broken across Linux and Mac OS X (haven't tested Windows yet).
scrollIntoView
does not work anymore as expected. Well... it does scroll the entire carousel to the top of the view port, but the image is not brought into view. Looks like Google messed up something recently 😔The carousel being full screen makes no difference. If there is overflow of the container, vertical scrollbar will appear. There can still be issues with vertical scrollbars showing up in Ubuntu in particular without any apparent overflow.
I haven't seen this same issue with "the carousel also scrolls to the top of the view port." I've been testing in Chrome Canary with good results.
Ok, I just figured out what my issue is. I'm an idiot who doesn't read the documentation.
I ignored the options arguments
inline
andblock
so far. When I implemented my carousel on Mac OS X a couple months ago I only specified'behavior': 'smooth'
and skipped the other two properties. It gave me perfect results back then, and that seems to have changed recently (change of default values?).Adding the two missing properties fixes the problem though. I get consistent results and scroll behavior in Firefox and Chrome and on both Linux and Mac:
Ugh... Sorry for having been such a Debbie Downer here. On the other hand that little conversation with you made me actually look a bit harder and fix the problem in the end. I was about to roll my own
scrollIntoView
implementation because it looked totally broken to me.So well... yay,
scrollIntoView
is actually awesome 😄For anyone else coming by: please ignore this thread
extra points for that gif
Actually, this sub-thread detour specifically just helped me learn about this for a Vue app, so thanks for that everyone :)
I used {block: "nearest"} instead of {block: "center"}. It prevents the vertical scroll.
I also developed a horizontal scroll-carousel. And it works really fine!