I recently implemented material-ui scrollable tabs in my project, referencing the documentation at https://mui.com/material-ui/react-tabs/#scrollable-tabs. Here is a snippet of the code I used:
<Tabs
value={value}
onChange={handleChange}
variant="scrollable"
scrollButtons="auto"
aria-label="scrollable auto tabs example"
style={{ position: 'fixed', backgroundColor: 'white' }} // Added this line!
>
<Tab label="All" component={Link} to="/main"></Tab>
<Tab label="Chicken" component={Link} to="/main/chicken"></Tab>
<Tab label="Pizza/Italian" component={Link} to="/main/pizza"></Tab>
<Tab label="Chinese" component={Link} to="/main/chinese" />
<Tab label="Korean" component={Link} to="/main/korean" />
<Tab label="Japanese/Tonkatsu" component={Link} to="/main/japanese" />
<Tab label="Pig's Feet/Bossam" component={Link} to="/main/pork" />
</Tabs>
After implementing these changes, I noticed that the header and scrollable tabs didn't stick when scrolling through the posts, which was necessary for the design. To address this, I added the following code to fix the position of the header and scrollable tab:
style={{position: 'fixed'}}
This adjustment successfully fixed the header and scrollable tabs in place. However, the scrolling functionality within the tabs stopped working as expected.
I'm seeking assistance on how to properly handle this issue. Any help would be greatly appreciated.