Material-ui: [Skeleton] zIndex occludes other elements

Created on 27 Apr 2020  路  2Comments  路  Source: mui-org/material-ui

I noticed this line:
https://github.com/mui-org/material-ui/blob/7bd0fd0b5051f154bdd4d0491708d84e6687e012/packages/material-ui-lab/src/Skeleton/Skeleton.js#L60
Makes the Skeleton animations to behave unexpectedly when content overlaps them, take for instance when they are part of a scrollable list with a sticky list item:
image
I bumped the zIndex of the sticky item meanwhile, but I am not sure of why the skeleton needs this zIndex value, I removed it via browser style inspection and the wave animation remained working correctly.

bug 馃悰 Skeleton good first issue

Most helpful comment

Thank you for the quick reply @oliviertassinari, sure thing. I'll take on the endeavor =)

All 2 comments

@luminaxster Thanks for raising, it seems that we can remove the index, do you want to work on a pull request? :)

diff --git a/packages/material-ui-lab/src/Skeleton/Skeleton.js b/packages/material-ui-lab/src/Skeleton/Skeleton.js
index b0cb4324a..ec2181ace 100644
--- a/packages/material-ui-lab/src/Skeleton/Skeleton.js
+++ b/packages/material-ui-lab/src/Skeleton/Skeleton.js
@@ -57,7 +57,6 @@ export const styles = (theme) => ({
       left: 0,
       right: 0,
       top: 0,
-      zIndex: 1,
     },
   },
   '@keyframes wave': {

Thank you for the quick reply @oliviertassinari, sure thing. I'll take on the endeavor =)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

newoga picture newoga  路  3Comments

iamzhouyi picture iamzhouyi  路  3Comments

ghost picture ghost  路  3Comments

anthony-dandrea picture anthony-dandrea  路  3Comments

finaiized picture finaiized  路  3Comments