First about the react-window
: The Scollbars in the react-window
are for the outercontainer
not for InnerContainer
. Now don't try to replace the outer container itself, unless you want to handle everything yourself. All the scroll events a few more things are attached to the outercontainer
.
Think of it like outer container decides/takes the size and the larger inner container gets scrolled inside it.
Now looking at your case I assume you are trying to make the table behave like any other grid where headers are fixed and content is scrolled if it's getting overflow. your table header is way lower in the element hierarchy than the inner container, so no way you can write any simple css (or js logic) to achieve in current hierarchy.
that's why even though you have set the stickyheader
for the MaterialUI
table
, it won't stick. Cause your whole table (MaterialUI
table
) is getting scrolled inside the outer container of react-window
.
I would suggest you to move your table header outside of the react-window
and only place the rows in the react-widow
. that's the way it's suppose to behave (i.e. react window treats everything in it as scrollable content). See one of the presentation below:

A little tip on redesigning of your table
(guess the alignment can be improved by additional css)

react-window-infinite-loader
is displaying only the data currently visible in the viewport, in order to speed up load times. As you scroll up, new data is loaded, and the old data is removed, but if you scroll very fast it can't keep up. Take a look at what's happening inside.MuiTableBody-root
- Eliezer Berlinreact-window-infinite-loader
. The table moves around using position:absolute andtop
. The real cause of the flickering is that thetop
attribute on thetable.MuiTable-root
isn't fast enough to keep up with your scrolling. - Eliezer Berlintable-layout:fixed;
to your table so that the width of the header isn't determined by the width of the currently visible content. - Eliezer Berlintable-layout: fixed;
, didn't see any difference. - Dev AKS