mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
Modify click events to prevent navigation. (#946)
Without preventDefault the link will navigate the page instead of opening the dropdown when the tabs are in the compact mode. Because the parent element also toggles on click, there is an additional stopPropagation to not toggle twice which in a no-op.
This commit is contained in:
parent
a1377f07de
commit
d5a6b5873b
1 changed files with 2 additions and 2 deletions
|
@ -130,8 +130,8 @@
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
class:bx--tabs-trigger-text="{true}"
|
class:bx--tabs-trigger-text="{true}"
|
||||||
href="{triggerHref}"
|
href="{triggerHref}"
|
||||||
on:click
|
on:click|preventDefault
|
||||||
on:click="{() => {
|
on:click|preventDefault|stopPropagation="{() => {
|
||||||
dropdownHidden = !dropdownHidden;
|
dropdownHidden = !dropdownHidden;
|
||||||
}}"
|
}}"
|
||||||
>
|
>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue