-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[Table] Sticky header table with buttons/inputs #17276
Comments
@Studio384 Thanks for the report. It seems that the fix is simple, creating a stacking context address it: diff --git a/packages/material-ui/src/TableCell/TableCell.js b/packages/material-ui/src/TableCell/TableCell.js
index a81b2417e..a034c45fe 100644
--- a/packages/material-ui/src/TableCell/TableCell.js
+++ b/packages/material-ui/src/TableCell/TableCell.js
@@ -101,6 +101,7 @@ export const styles = theme => ({
position: 'sticky',
top: 0,
left: 0,
+ zIndex: 1,
backgroundColor: theme.palette.background.default,
},
}); |
Thanks, Super easy fix, was obvious but didn't try until seeing this, |
To be honest, I don't know why it happens with such component. Maybe we already create a stacking context for them? |
Does anyone want to submit a pull request for the problem? :) |
I can open a new issue for this, but I figure this is basically the same issue. Buttons work, but the checkboxes are still affected. |
@Lavoaster I can't reproduce it. What environment are you using? Do you have a screenshot, |
@oliviertassinari Sorry, I just realised that the issue is a little bit different. In this case if you try to check the box in the header, whilst a checkbox is beneath it, it checks the the one beneath the sticky header. I'm on mac OS 10.15, with Chrome |
@Lavoaster I can reproduce it too. The z-index: 1 added in #17389 conflicts. What about increasing the z-index to 2 for the sticky header? |
@oliviertassinari That makes it work for me. |
@Lavoaster Do you want to submit a pull request? Or do you have a better fix in mind? :) |
Current Behavior 😯
https://codesandbox.io/s/create-react-app-6v20t
Buttons and input are visible on top of the sticky header.
Expected Behavior 🤔
The buttons and input go below the sticky header.
Steps to Reproduce 🕹
Use a button or input field (I haven't checked anything else) in a table with sticky headers.
Context 🔦
I'm trying to make a table which has options within its rows.
Your Environment 🌎
The text was updated successfully, but these errors were encountered: