-
Notifications
You must be signed in to change notification settings - Fork 79
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
Really strange scrolling issue when paging with firefox #562
Comments
Instead of doing scrollTo(0,0) use scrollIntoView to get the `section#products` start to be visible. WIP, still requires a css rule
I am using this in my code and it seems to work properly.
I set my theme to scroll to the top of product list with some margin when using pagination. And it doesn't sroll at all when using filters, it was annoying to scroll back down when you want to select more filters. |
I can see how that would be bad when using filters. So this requires even more design.. the event should know if it was paging operation or filter operation and then act accordingly. |
Change pager scrolling behaviour, Fixes #562
Sometimes
scrollTo(0,0)
does not work in firefox. This is really strange and I cannot even reproduce this all the time, but enough to be really annoying :DSteps to reproduce
=>
hummingbird/src/js/modules/facetedsearch/update.ts
Line 102 in 986d1a2
It looks like firefox gets confused when the content changes and it doesn't always understand that it should scroll.. (also tried adding a small delay with
setTimeout
but that didn't seem to work either)I can force it to work consistently by adding
window.scrollTo(0,1)
before thewindow.scrollTo(0,0)
but that seems wrong.This does not seem to ever happen with chrome.
As a side not the scrolling should probably happen to be at the top of
<div id="products">
so that for mobile users the products are shown even if the header is tall.. In place of window.scrollTo(0,0) should be something likeand as we have a fixed header give it some scroll margin
In my opinion the scroll-margin-top should be set so that in desktop view the text "There are 8 products" is still visible and in mobile view filters and sort order are still visible
The text was updated successfully, but these errors were encountered: