From 90452a7b874007ba1278ceab4c6c2c9baae70eb7 Mon Sep 17 00:00:00 2001 From: brunnerh Date: Fri, 24 Dec 2021 01:58:16 +0100 Subject: [PATCH] Modify click events to prevent navigation. Without preventDefault the link will navigate the page instead of opening the dropdown when the tabs are in the compact mode. Because the parent element also toggles on click, there is an additional stopPropagation to not toggle twice which in a no-op. --- src/Tabs/Tabs.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Tabs/Tabs.svelte b/src/Tabs/Tabs.svelte index b844066e..b7b885b0 100644 --- a/src/Tabs/Tabs.svelte +++ b/src/Tabs/Tabs.svelte @@ -130,8 +130,8 @@ tabindex="-1" class:bx--tabs-trigger-text="{true}" href="{triggerHref}" - on:click - on:click="{() => { + on:click|preventDefault + on:click|preventDefault|stopPropagation="{() => { dropdownHidden = !dropdownHidden; }}" >