fix(ui-shell): stop propagation when clicking header action button

This commit is contained in:
Eric Liu 2020-08-01 15:36:38 -07:00
commit 4d93396d01
2 changed files with 5 additions and 3 deletions

View file

@ -66,7 +66,7 @@
class:action-text={text} class:action-text={text}
{...$$restProps} {...$$restProps}
on:click on:click
on:click={() => { on:click|stopPropagation={() => {
isOpen = !isOpen; isOpen = !isOpen;
dispatch(isOpen ? 'open' : 'close'); dispatch(isOpen ? 'open' : 'close');
}}> }}>

View file

@ -109,6 +109,8 @@
focusable: false, focusable: false,
style: undefined, style: undefined,
}; };
let isOpen = !true;
</script> </script>
{#if story === 'header'} {#if story === 'header'}
@ -169,8 +171,8 @@
<HeaderUtilities> <HeaderUtilities>
<HeaderAction <HeaderAction
type="Switcher" type="Switcher"
icon={iSwitcher} icon={isOpen ? iAccount : iSwitcher}
isOpen bind:isOpen
on:open={() => { on:open={() => {
console.log('on:open'); console.log('on:open');
}} }}