-
Notifications
You must be signed in to change notification settings - Fork 932
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
The selection box is misplaced when I scroll the table (only safari) #900
Comments
Hello @RomanKwok. Can you create a codesandbox example that demonstrates the issue? I have a PC, so I cannot download the latest safai for testing. There are some options I can use for testing, but the free trials are limited in capabilities, so having an example ready to go that I can load in a browser will be a big help. |
Hi, @gabrielliwerant. Thanks for your reply. |
I can confirm this. It is also present in iOS devices on Chrome (and probably other browsers). If you alter @RomanKwok's example use to use "scrollMaxHeight", you'll see the problem on the iPhone in Chrome. If you create a table with 10+ rows, you'll also see the issue happens for the table headers when you scroll right. The issue is due to "position: sticky" in TableSelectCell.js and TableHeadCell.js. It's unclear to me if the bug is in Safari and iOS Chrome's implementation of sticky, or the desktop browser's implementation of sticky. Whatever the case, it can be fixed: simply don't stick for the positions you don't want to stick. What this means is removing "top:0px" from the rule for checkboxes that aren't the header, and removing "left:0px" for table header labels. Ex: TableSelectCell.js
TableHeadCell.js:
There's also a related bug here: if you have 10+ columns and you scroll right, you'll see the column text overlaps the checkboxes on the left. This can be fixed by setting the background color of TableSelectCells to theme.palette.background.paper and adjusting the CSS rules in TableBodyRow.js:
|
Issue fixed in version 3.0.0 of the table. |
The text was updated successfully, but these errors were encountered: