From 28d515d67e71017f4b17e203609ae761cf2570e4 Mon Sep 17 00:00:00 2001 From: Jeremias Peier Date: Thu, 8 Feb 2024 08:40:26 +0100 Subject: [PATCH] fix: don't close when moving cursor from trigger to popover --- src/components/popover/popover/popover.scss | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/components/popover/popover/popover.scss b/src/components/popover/popover/popover.scss index 581310c484..2230d65f38 100644 --- a/src/components/popover/popover/popover.scss +++ b/src/components/popover/popover/popover.scss @@ -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); } @@ -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 {