Aspiring hobby developer here. I’ve used create-react-app to start a new project and import the MUI dependencies.
I added a fixed BottomNavigation like this:
In CodeSandbox the BottomNavigation is not transparant as I would expect. However, on my development machine, the BottomNavigation is transparant. Meaning that when scrolling through longer pages, the content is visible through the BottomNavigation.
I have no idea what could be causing this? Could it be a bug in my MUI-version or should I check something in my code?
Any help is highly appreciated!
Thanks for your time,
Maarten
2
Answers
you probably have a theme on your development machine that changes the style of the
BottomNavigation
component, can you show the code you have on your machine ?It’s not whether the
BottomNavigation
is transparent or not (which is isn’t) — the label on your TextFields have a defaultzIndex
value of1
and yourBottomNavigation
does not have azIndex
defined at all. This is making the label appear to "float above" theBottomNavigation
in the current stacking context. You can correct this by adding azIndex
of 1 (or higher) to thesx
prop ofBottomNavigation
. For example:FYI: The
BottomNavigation
component API does not have anelevation
prop. That’s used by Paper for the drop shadow effect (where I’m assuming you got your example).Working CodeSandbox: https://codesandbox.io/s/unwanted-transparant-bottomnavigation-forked-cz97df