mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11: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}
|
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');
|
||||||
}}>
|
}}>
|
||||||
|
|
|
@ -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');
|
||||||
}}
|
}}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue