diff --git a/ts/components/ColorPicker.svelte b/ts/components/ColorPicker.svelte index 4430452c9..b2e8288fd 100644 --- a/ts/components/ColorPicker.svelte +++ b/ts/components/ColorPicker.svelte @@ -6,21 +6,23 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import { onMount, createEventDispatcher, getContext } from "svelte"; import { nightModeKey } from "./contextKeys"; - export let id: string; - export let className = ""; - export let tooltip: string | undefined; + export let id: string | undefined = undefined; + let className = ""; + export { className as class }; + + export let tooltip: string | undefined = undefined; const nightMode = getContext(nightModeKey); - let buttonRef: HTMLButtonElement; - let inputRef: HTMLInputElement; - function delegateToInput() { inputRef.click(); } + let buttonRef: HTMLButtonElement; + let inputRef: HTMLInputElement; + const dispatch = createEventDispatcher(); - onMount(() => dispatch("mount", { button: buttonRef })); + onMount(() => dispatch("mount", { button: buttonRef, input: inputRef }));