Skip to content

Commit

Permalink
fix: don't close when moving cursor from trigger to popover
Browse files Browse the repository at this point in the history
  • Loading branch information
jeripeierSBB committed Feb 8, 2024
1 parent c0985e4 commit 28d515d
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/components/popover/popover/popover.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
left: var(--sbb-popover-arrow-position-x);
bottom: calc(100% - calc(var(--sbb-popover-arrow-size) / 2));
background-color: var(--sbb-popover-background);
border-radius: #{sbb.px-to-rem-build(4)} 0;
border-radius: var(--sbb-border-radius-2x) 0;
transform: rotate(45deg);
}

Expand Down Expand Up @@ -119,6 +119,24 @@
@include sbb.if-forced-colors {
outline: var(--sbb-border-width-1x) solid CanvasText;
}

// Transparent area which increases hover area in order to not trigger closing too early.
&::before {
content: '';
display: block;
position: absolute;
inset: 0;
z-index: -1;
background-color: transparent;

:host([data-position='below']) & {
inset-block-start: calc(-1 * var(--sbb-spacing-fixed-6x));
}

:host([data-position='above']) & {
inset-block-end: calc(-1 * var(--sbb-spacing-fixed-6x));
}
}
}

.sbb-popover__content {
Expand Down

0 comments on commit 28d515d

Please sign in to comment.