Why does setting a maxHeight
for muiTableProps
interfere with sticky header?
#969
Unanswered
imnasnainaec
asked this question in
Q&A
Replies: 1 comment 1 reply
-
@imnasnainaec It's simply because you should only be adding a max-height on the table conatiner div instead of the muiTableContainerProps: { sx: { maxHeight: "400px" } }, is the proper way to add a max-height to the table |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I encountered an issue in which I had specified
muiTableProps: { sx: { maxHeight: "400px" } },
and the result was that when you scrolled the table down more than ~400px, the sticky header would unstick.
Here's the issue reproduced by minimally modifying the Enable Sticky Header and Footer Demo: https://codesandbox.io/p/devbox/tender-currying-8yk6cm
I'm not posting this as a GitHub Issue because the problem is avoided by switching from
muiTableProps
tomuiTableContainerProps
. But I'm posting it here:Beta Was this translation helpful? Give feedback.
All reactions