-
-
Notifications
You must be signed in to change notification settings - Fork 788
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
Fix scrolling issues in RTL in Chrome, Firefox and Edge #215
Conversation
Pull in changes from master
Merge in latest
@bvaughn Any chance you could look at this? |
This is a side project of mine. I will look when I get the time and have the energy 😅 RTL issuea are particularly unpleasant to deal with and I'm not really looking forward to sorting through the prs and issues about it. |
I completely understand. The fix I've written wasn't pleasant to write at all but I've tested it in all the scenarios I can think of and think I've got it covered. An alternative solution would be to write some sort of shim to patch how browsers get and set |
Hopefully this fixes #159 and fixes #198.
The code is essentially now keeping an internal normalized representation of scrollLeft which is used as scrollLeft used to be to determine the indices to be rendered. Anywhere that scrollLeft is reported out or received in, e.g.
onScroll
andscrollTo
it reports and expects scrollLeft as the browser would represent it.I've used the
normalize-scroll-left
library to determine what type of scrolling the current browser implements.I've changed the ScrollToItem file to make it easier to see the changes in action hopefully proving the validity of the code changes.