From 4d93396d01c7e48abae3a4582b825e8d1aa9a745 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Sat, 1 Aug 2020 15:36:38 -0700 Subject: [PATCH] fix(ui-shell): stop propagation when clicking header action button --- src/UIShell/GlobalHeader/HeaderAction.svelte | 2 +- src/UIShell/UIShell.Story.svelte | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/UIShell/GlobalHeader/HeaderAction.svelte b/src/UIShell/GlobalHeader/HeaderAction.svelte index 6480f2d1..74759bb1 100644 --- a/src/UIShell/GlobalHeader/HeaderAction.svelte +++ b/src/UIShell/GlobalHeader/HeaderAction.svelte @@ -66,7 +66,7 @@ class:action-text={text} {...$$restProps} on:click - on:click={() => { + on:click|stopPropagation={() => { isOpen = !isOpen; dispatch(isOpen ? 'open' : 'close'); }}> diff --git a/src/UIShell/UIShell.Story.svelte b/src/UIShell/UIShell.Story.svelte index 46fd17c4..04f5883f 100644 --- a/src/UIShell/UIShell.Story.svelte +++ b/src/UIShell/UIShell.Story.svelte @@ -109,6 +109,8 @@ focusable: false, style: undefined, }; + + let isOpen = !true; {#if story === 'header'} @@ -169,8 +171,8 @@ { console.log('on:open'); }}