-
Notifications
You must be signed in to change notification settings - Fork 605
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
Window scrolls to show full gallery on initial click #76
Comments
Thanks for reporting this! This behavior is actually a feature of keyboard accessibility. By clicking/tapping on a gallery, it adds If this behavior is really bugging you, you can disable it with |
Good to know! Thanks for the help. |
Can't you read the scroll position before setting focus and then set the scroll afterwards to prevent the jump? Slightly dirty, but better than users disabling accessibility as a workaround. |
@esseb Interesting idea, but I suspect messing with native browser behavior in this matter would lead to more problems that it resolves. |
After looking deeper into this, I've added a hack to reset the scroll position after the element has been focused. The next version of Flickity (after v1.1.1) will have this fix. |
Fix double playPlayer * tag 'v1.2.1': 👷 build v1.2.1 🐞 Prevent double autoPlay starting 👷 build v1.2.0 📝 switch to npmcdn 🐱 Add .github with issue template 🐞 remove touchVerticalScroll logic, not needed 🐞 cellAlign w/ freeScroll on cellChange Add aria-label to previous and next buttons 🛠 add playPlayer, pausePlayer, unpausePlayer methods v1.1.2 in dist file banner comments build v1.1.2 Fix initializing with high initialIndex; hack to fix scroll jump after focus; Fixes metafizzy#76 add pauseAutoPlayOnHover option; Ref metafizzy#55 alphabetize bower.json dependencies
I came across a problem with this fix today - in my case I'm using Flickity inside a Stackla widget, i.e. inside an iframe. The iframe is always resized to fit its content, so is never scrollable. For some reason, on an iPhone (tested in iOS 10.3.2 and 10.3.3, Safari 10.0), the call to Because the |
Perhaps an option to disable the focus/scroll in initialisation would help? I'm having to use |
@homerjam The scroll-jump behavior should no longer occur. What device/browser are you seeing it in? |
I'm seeing it in iOS simulator (12.x) and Safari (12.0.2). Specifically I'm developing a Nuxt site (SSR/SPA framework for Vue). The unwanted scroll/focus issue occurs when transitioning to a page - not sure if this is an instance that may not have been accounted for? Thanks |
Thanks for reporting that. Sounds like an intricate use case. If you can boil it down to a live demo I'd be happy to take a look. |
I'm experiencing the scroll-jump when clicking the prev / next buttons with Flickity v2.2, in Safari 12.0.3 on MacOS Mojave 10.14.3 |
I've only been able to recreate this behavior in WebKit browsers:
After a flickity instance has been initialized, scroll the page so it's only half visible. Click on a cell and the window will jump to make the whole flickity instance visible.
http://codepen.io/jasonwbullok/pen/PwBrzG
(I'm also seeing this behavior on the flickity homepage instances)
The text was updated successfully, but these errors were encountered: