fix(header-action): stop propagation on button click event (#1185)

This commit is contained in:
metonym 2022-03-19 10:44:05 -07:00 committed by GitHub
commit d9ee8cb2d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -58,16 +58,16 @@
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');
}}" }}"
> >
<svelte:component this="{icon}" style="{isOpen ? 'display: none' : ''}" /> {#if isOpen}
<svelte:component <svelte:component this="{closeIcon}" />
this="{closeIcon}" {:else}
style="{!isOpen ? 'display: none' : ''}" <svelte:component this="{icon}" />
/> {/if}
<slot name="text"> <slot name="text">
{#if text}<span>{text}</span>{/if} {#if text}<span>{text}</span>{/if}
</slot> </slot>