1
0
Fork 0
mirror of synced 2024-09-20 19:33:10 +12:00

Switch TooltipWrapper to AbsTooltip. Messages were being truncated

This commit is contained in:
Dean 2024-06-25 10:01:32 +01:00
parent d50a8e0746
commit 27917c78d1

View file

@ -1,12 +1,10 @@
<script> <script>
import Tooltip from "./Tooltip.svelte"
import Icon from "../Icon/Icon.svelte" import Icon from "../Icon/Icon.svelte"
import AbsTooltip from "./AbsTooltip.svelte"
export let tooltip = "" export let tooltip = ""
export let size = "M" export let size = "M"
export let disabled = true export let disabled = true
let showTooltip = false
</script> </script>
<!-- svelte-ignore a11y-no-static-element-interactions --> <!-- svelte-ignore a11y-no-static-element-interactions -->
@ -14,20 +12,15 @@
<slot /> <slot />
{#if tooltip} {#if tooltip}
<div class="icon-container"> <div class="icon-container">
<AbsTooltip text={tooltip}>
<div <div
class="icon" class="icon"
class:icon-small={size === "M" || size === "S"} class:icon-small={size === "M" || size === "S"}
on:mouseover={() => (showTooltip = true)}
on:mouseleave={() => (showTooltip = false)}
on:focus on:focus
> >
<Icon name="InfoOutline" size="S" {disabled} /> <Icon name="InfoOutline" size="S" {disabled} hoverable />
</div> </div>
{#if showTooltip} </AbsTooltip>
<div class="tooltip">
<Tooltip textWrapping={true} direction={"bottom"} text={tooltip} />
</div>
{/if}
</div> </div>
{/if} {/if}
</div> </div>
@ -44,14 +37,6 @@
margin-left: 5px; margin-left: 5px;
margin-right: 5px; margin-right: 5px;
} }
.tooltip {
position: absolute;
display: flex;
justify-content: center;
top: 15px;
z-index: 200;
width: 160px;
}
.icon { .icon {
transform: scale(0.75); transform: scale(0.75);
} }