-
-
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
RTL support is slightly broken for Safari and Edge #159
Comments
At least in the case of Safari, the |
A working progress branch is on going. |
I think #198 is as a result of the manipulation of scrollLeft to calculate the offset for this issue. The onScroll event emitted by the grid has the manipulated offset value rather than the scrollLeft position that the browser being used understands. If it were possible to keep the normalisation of the offset internal to react-window #198 would be at least partially fixed. Would it be useful to use a library such as https://github.com/alitaheri/normalize-scroll-left to work around these issues? |
I've attempted to fix the problems caused by the varying ways browsers report scrollLeft in rtl in this branch. Hopefully it fixes the issues seen in this bug as well as #198. Before I write unit tests to try to test what I've written I'd like some feedback as to whether it's even likely to get accepted as a pull request @bvaughn . What it's doing is maintaining a normalized version of the I've modified the |
I'm actually not sure how to meaningfully test the fixes in this branch without writing tests based around |
@MarkFalconbridge as you can see in my comment above, I was working in a fix for this issue. |
@davidgarsan I did try your branch but we need to use the list and the grid and both the |
I understand. Currently I only need the List, but soon I'll work with the Grid so I need to have it fixed by then. |
Fixed via #251 |
Bug fix released in 1.8.2 - https://github.com/bvaughn/react-window/blob/master/CHANGELOG.md#182 |
Looks good but I'm still seeing an issue in Edge. Go to https://react-window.now.sh/#/examples/list/fixed-size-rtl using Edge and click the scroll to 500 buttons. The content of the list/grid disappears. Using the horizontal scroll bars results in the grid/list content appearing/disappearing. |
Works for me, but I'm testing with OSX Edge preview. |
I'm using Microsoft Edge 44.17763.1.0 (Microsoft EdgeHTML 18.17763) and it fails on that. |
As far as I can see your fix means that when used in RTL anyone using the onScroll methods can only use the scrollLeft value contained in them for driving another react-window component because the scrollLeft values represent react-window's normalized version of the browser's scrollLeft value. That's fine but should probably be documented in the descriptions of onScroll. |
Based on the Mozilla docs it looks like Chrome is reports incorrect values for
scrollLeft
when the direction is "rtl":Rather than reporting a range of <= 0, Chrome reports the distance in pixels measured from the left. (View the console output in this repro case.)
I've tried to accommodate this broken behavior (fb15909 and dcb9c55) but the fix is kludgy.
It also doesn't fully work for Safari and Edge:
It looks like when the scroll position reaches the right, the
scrollLeft
value sometimes rolls over from 0 to a really high number, causing the list to blank out.I am not very familiar with RTL layouts. Help would be appreciated.
The text was updated successfully, but these errors were encountered: