feat(tooltip): elevate z-index of tooltip when open

This commit is contained in:
Eric Y Liu 2021-03-13 05:41:19 -08:00
commit 6a609240cd
2 changed files with 7 additions and 2 deletions

View file

@ -4,7 +4,9 @@
import Preview from "../../components/Preview.svelte";
</script>
### Default (icon-only, "bottom" direction)
### Default
By default, the tooltip is triggered by an information icon.
<Tooltip tooltipBodyId="tooltip-body">
<p id="tooltip-body">

View file

@ -171,7 +171,10 @@
}
}}" />
<div {...$$restProps} style="{$$restProps.style}; position: relative;">
<div
{...$$restProps}
style="{open ? 'z-index: 1;' : ''}{$$restProps.style}; position: relative;"
>
{#if !hideIcon}
<div bind:this="{ref}" id="{triggerId}" class:bx--tooltip__label="{true}">
<slot name="triggerText">{triggerText}</slot>