mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-10 08:07:03 +00:00
fix(frontend): Change button click propagation (#690)
Co-authored-by: Ruben Fiszel <ruben@rubenfiszel.com>
This commit is contained in:
co-authored by
Ruben Fiszel
parent
e66522d266
commit
911e6c32d6
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
import { goto } from '$app/navigation'
|
||||
import { classNames } from '$lib/utils'
|
||||
import Icon from 'svelte-awesome'
|
||||
import { ButtonType } from './model'
|
||||
@@ -45,6 +44,7 @@
|
||||
}
|
||||
|
||||
$: buttonProps = {
|
||||
id,
|
||||
class: classNames(
|
||||
colorVariants[color][variant],
|
||||
variant === 'border' ? 'border' : '',
|
||||
@@ -63,9 +63,9 @@
|
||||
}
|
||||
|
||||
function onClick(event: MouseEvent) {
|
||||
event.preventDefault()
|
||||
dispatch('click', event)
|
||||
if (href) {
|
||||
event.preventDefault()
|
||||
goto(href)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
bind:element={ref}
|
||||
{...commonProps}
|
||||
btnClasses="{$$slots.main ? '!rounded-l-none' : ''} {toggleClasses}"
|
||||
on:click={() => {}}
|
||||
>
|
||||
<slot name="toggle">
|
||||
<!-- Invisible, but needed to match the height of the 'main' button -->
|
||||
|
||||
Reference in New Issue
Block a user