Skip to content

Commit

Permalink
fix: remove z-index workaround from Ripple
Browse files Browse the repository at this point in the history
  • Loading branch information
hmerritt committed Dec 15, 2023
1 parent fdec94b commit fcd4f73
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/view/components/experimental/Ripple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export const Ripple = ({
pointerEvents: "none",
backgroundColor: "rgba(20, 20, 20, 0.1)", // @TODO: theme me
borderRadius: "50%",
zIndex: "-1 !important",
zIndex: "10",

/* Transition configuration */
transitionProperty: "transform opacity",
Expand All @@ -135,7 +135,7 @@ export const Ripple = ({

// Finally, append it to DOM
container.appendChild(ripple);
button.prepend(container);
button.appendChild(container);

// rAF runs in the same frame as the event handler
// Use double rAF to ensure the transition class is added in next frame
Expand Down Expand Up @@ -203,16 +203,6 @@ const ripple = css`
overflow: hidden;
transition: 150ms background-color;
/* Workaround to get ripple to render behind children, but in front of the background-color */
/* @Note: Maybe just accept it will render above and delete this */
& {
z-index: 2;
& > * {
z-index: 3;
}
}
&.hoverBg:hover {
background-color: #f2f2f2; // @TODO: theme me
}
Expand Down

0 comments on commit fcd4f73

Please sign in to comment.