From 0d7447ef3f888f1da172f91c339056bc8372cdd1 Mon Sep 17 00:00:00 2001 From: Shinichi Okada <147320+shinokada@users.noreply.github.com> Date: Sat, 21 Sep 2024 01:55:35 +0200 Subject: [PATCH] Make Popper close automaticially after 3secs on touch devices When triggering a Tooltip/Speeddial/Popover on a touch device it will close after 3secs (or "closeOnTouchDelay" ms) when set to trigger="hover". Furthermore Svelte 5 will now behave identical to Svelte 4 (instead of two touches a single one is required) --- src/lib/speed-dial/SpeedDial.svelte | 6 ++--- src/lib/utils/Popper.svelte | 34 ++++++++++++++++++--------- src/routes/docs/components/tooltip.md | 6 +++-- 3 files changed, 30 insertions(+), 16 deletions(-) diff --git a/src/lib/speed-dial/SpeedDial.svelte b/src/lib/speed-dial/SpeedDial.svelte index 156b6811f..99db9d8e8 100644 --- a/src/lib/speed-dial/SpeedDial.svelte +++ b/src/lib/speed-dial/SpeedDial.svelte @@ -46,7 +46,7 @@ setContext('speed-dial', { pill, tooltip, textOutside }); let divClass: string; - $: divClass = twMerge(defaultClass, 'group', $$props.class); + $: divClass = twMerge(defaultClass, $$props.class); let poperClass: string; $: poperClass = twMerge(popperDefaultClass, ['top', 'bottom'].includes(placement.split('-')[0]) && 'flex-col'); @@ -59,7 +59,7 @@ {#if gradient} - @@ -68,7 +68,7 @@ {:else} - + + Hover tooltip content Click tooltip content +
{actions}
``` ## Disable arrow