Skip to content

Commit f454220

Browse files
fix(DT-4269): namespace selector tooltip overflow (#3676)
* Forward portalOffset through tooltip * use a portal with a portal offset on combobox action tooltip link
1 parent 5eae94c commit f454220

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

src/lib/holocene/combobox/combobox.svelte

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,12 @@
587587
{:else if href}
588588
<div class="ml-1 flex h-full items-center border-l border-subtle p-0.5">
589589
{#if actionTooltip}
590-
<Tooltip text={actionTooltip} right>
590+
<Tooltip
591+
text={actionTooltip}
592+
right
593+
usePortal
594+
portalOffset={{ x: 6 }}
595+
>
591596
<Button
592597
variant="ghost"
593598
size="xs"

src/lib/holocene/tooltip.svelte

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
import type { IconName } from '$lib/holocene/icon';
66
import Icon from '$lib/holocene/icon/icon.svelte';
77
import Portal from '$lib/holocene/portal/portal.svelte';
8-
import type { PortalPosition } from '$lib/holocene/portal/types';
8+
import type {
9+
PortalOffset,
10+
PortalPosition,
11+
} from '$lib/holocene/portal/types';
912
import type { Only } from '$lib/types/global';
1013
1114
const HOVER_HIDE_DELAY_MS = 120;
@@ -19,6 +22,7 @@
1922
tooltipClass?: string;
2023
show?: boolean;
2124
usePortal?: boolean;
25+
portalOffset?: PortalOffset;
2226
scrollContainer?: string;
2327
};
2428
@@ -79,6 +83,7 @@
7983
export let tooltipClass = '';
8084
export let show = false;
8185
export let usePortal = false;
86+
export let portalOffset: PortalOffset | undefined = undefined;
8287
export let scrollContainer: string | undefined = undefined;
8388
8489
let wrapperElement: HTMLElement | null = null;
@@ -166,6 +171,7 @@
166171

167172
{#if usePortal && wrapperElement}
168173
<Portal
174+
offset={portalOffset}
169175
anchor={wrapperElement}
170176
open={isOpen}
171177
position={portalPosition}

0 commit comments

Comments
 (0)