mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
fix(ui-shell): stop propagation when clicking header action button
This commit is contained in:
parent
66bc076307
commit
4d93396d01
2 changed files with 5 additions and 3 deletions
|
@ -66,7 +66,7 @@
|
|||
class:action-text={text}
|
||||
{...$$restProps}
|
||||
on:click
|
||||
on:click={() => {
|
||||
on:click|stopPropagation={() => {
|
||||
isOpen = !isOpen;
|
||||
dispatch(isOpen ? 'open' : 'close');
|
||||
}}>
|
||||
|
|
|
@ -109,6 +109,8 @@
|
|||
focusable: false,
|
||||
style: undefined,
|
||||
};
|
||||
|
||||
let isOpen = !true;
|
||||
</script>
|
||||
|
||||
{#if story === 'header'}
|
||||
|
@ -169,8 +171,8 @@
|
|||
<HeaderUtilities>
|
||||
<HeaderAction
|
||||
type="Switcher"
|
||||
icon={iSwitcher}
|
||||
isOpen
|
||||
icon={isOpen ? iAccount : iSwitcher}
|
||||
bind:isOpen
|
||||
on:open={() => {
|
||||
console.log('on:open');
|
||||
}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue