@@ -10,6 +10,7 @@
|
||||
import type { SupportedAs } from "$lib/internal/elements";
|
||||
import type { HTMLActionArray } from "$lib/hooks/use-actions";
|
||||
import Render from "$lib/utils/Render.svelte";
|
||||
import { resolveButtonType } from "$lib/utils/resolve-button-type";
|
||||
const forwardEvents = forwardEventsBuilder(get_current_component(), [
|
||||
"change",
|
||||
]);
|
||||
@@ -49,6 +50,7 @@
|
||||
$: propsWeControl = {
|
||||
id,
|
||||
role: "switch",
|
||||
type: resolveButtonType({ type: $$props.type, as }, $switchStore),
|
||||
tabIndex: 0,
|
||||
"aria-checked": checked,
|
||||
"aria-labelledby": $labelContext?.labelIds,
|
||||
@@ -80,7 +82,6 @@
|
||||
{slotProps}
|
||||
use={[...use, forwardEvents]}
|
||||
name={"Switch"}
|
||||
bind:el={$switchStore}
|
||||
on:click={handleClick}
|
||||
on:keyup={handleKeyUp}
|
||||
on:keypress={handleKeyPress}
|
||||
|
||||
Reference in New Issue
Block a user