From 51ede6df8f6bd4818b692b47fe6af53fce5fd022 Mon Sep 17 00:00:00 2001 From: metonym Date: Thu, 18 Nov 2021 07:41:02 -0800 Subject: [PATCH] fix(tabs): dispatch change event in update/change context methods --- src/Tabs/Tabs.svelte | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Tabs/Tabs.svelte b/src/Tabs/Tabs.svelte index 06098f74..933a3793 100644 --- a/src/Tabs/Tabs.svelte +++ b/src/Tabs/Tabs.svelte @@ -46,10 +46,8 @@ content.update((_) => [..._, { ...data, index: _.length }]); }, update: (id) => { - if (currentIndex !== $tabsById[id].index) { - currentIndex = $tabsById[id].index; - dispatch("change", currentIndex); - } + currentIndex = $tabsById[id].index; + dispatch("change", currentIndex); }, change: (direction) => { let index = currentIndex + direction; @@ -75,6 +73,7 @@ } currentIndex = index; + dispatch("change", currentIndex); }, });