Skip to content

Commit

Permalink
[@mantine/core] Tooltip: Fix z-index during transitions
Browse files Browse the repository at this point in the history
  • Loading branch information
rtivital committed Jul 30, 2021
1 parent b75b264 commit 6a3f337
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/mantine-core/src/components/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@ export function Tooltip({
timingFunction={transitionTimingFunction}
>
{(transitionStyles) => (
<div className={classes.wrapper} style={{ ..._styles.wrapper, ...transitionStyles }}>
<div
className={classes.wrapper}
style={{ ..._styles.wrapper, ...transitionStyles, zIndex }}
>
<ArrowBody
id={tooltipId}
gutter={gutter}
Expand Down
3 changes: 1 addition & 2 deletions src/mantine-core/src/components/Tooltip/demos/positions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Tooltip, Badge, Group } from '../../../index';

function Demo() {
const tooltips = (['top', 'right', 'bottom', 'left'] as const).map((position, index) => {
const placements = (['start', 'center', 'end'] as const).map((placement, placementIndex) => (
const placements = (['start', 'center', 'end'] as const).map((placement) => (
<Tooltip
data-mantine-composable
key={placement}
Expand All @@ -12,7 +12,6 @@ function Demo() {
label={`${position}-${placement}`}
withArrow
gutter={10}
style={{ zIndex: 6 - index - (position === 'right' ? placementIndex : -placementIndex) }}
>
<Badge color="blue" size="lg">
{`${position}-${placement}`}
Expand Down

0 comments on commit 6a3f337

Please sign in to comment.