diff --git a/src/ListBox/ListBoxMenuItem.svelte b/src/ListBox/ListBoxMenuItem.svelte index 26b2b266..b71d1b91 100644 --- a/src/ListBox/ListBoxMenuItem.svelte +++ b/src/ListBox/ListBoxMenuItem.svelte @@ -4,6 +4,11 @@ /** Set to `true` to enable the highlighted state */ export let highlighted = false; + + let ref = null; + + $: isTruncated = ref?.offsetWidth < ref?.scrollWidth; + $: title = isTruncated ? ref?.innerText : undefined;
-
+