Skip to content
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

Synchronizing a grid and a list in RTL has unexpected behavior #198

Closed
MarkFalconbridge opened this issue Apr 3, 2019 · 5 comments
Closed
Labels
😭 bug Something isn't working

Comments

@MarkFalconbridge
Copy link
Contributor

In the sandbox linked to below, the top list has its scroll position set whenever the grid below is scrolled. If you change the direction props of both the list and the grid to "ltr", all works fine.

If you use it as provided with the list and grid direction props set to "rtl" in Chrome the list doesn't appear to render anything, then when you scroll horizontally items do appear but only some of them and they appear to scroll the wrong way. In Firefox the list is initially rendered correctly but as soon as you start to scroll the grid horizontally the list items don't scroll and then disappear.

https://codesandbox.io/s/1077qx12n3

This issue is probably related to #159 .

@MarkFalconbridge
Copy link
Contributor Author

MarkFalconbridge commented Apr 3, 2019

A work around for this is to use the outerRef props for the grid and the list and set the scrollLeft attribute directly on the raw HTMLDivElement. This can be seen here - https://codesandbox.io/s/4qljy74oo7.

Unfortunately, this only partially works when the list used is a VariableSizeList as seen here - https://codesandbox.io/s/x2y1k5p5z4. When you attempt to scroll the data grid there is a lag before the headings list starts to scroll.

@MarkFalconbridge
Copy link
Contributor Author

MarkFalconbridge commented Apr 3, 2019

A further workaround for the VariableSizeList lag part of this issue is to manually set the width of the style attribute of the innerRef div when setting the outerRef scrollLeft. This is possible in my case because I know how big in total the innerRef needs to be to accommodate the individual items. Here is a sandbox illustrating a workaround for the scroll lag - https://codesandbox.io/s/2vjvpjo4kn.

@bvaughn
Copy link
Owner

bvaughn commented Apr 3, 2019

Just an FYI, I don't have the bandwidth to look into this any time soon. Particularly if it is related to #159 (browser bug). If you need this fixed, you'll probably need to dig into it yourself.

@bvaughn
Copy link
Owner

bvaughn commented May 28, 2019

This was also fixed by #251!

Tested in Chrome, Firefox, and Safari.

@bvaughn bvaughn closed this as completed May 28, 2019
@bvaughn
Copy link
Owner

bvaughn commented May 28, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
😭 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants