From 9385dc3813be01fbc05df9321437805eaaaf8f10 Mon Sep 17 00:00:00 2001 From: Katie Toler Date: Tue, 15 Oct 2024 16:50:04 -0600 Subject: [PATCH 1/6] Make outer input div also selectable and reactive --- src/lib/holocene/input/input.svelte | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/lib/holocene/input/input.svelte b/src/lib/holocene/input/input.svelte index 7a74e9928..a6caeabd4 100644 --- a/src/lib/holocene/input/input.svelte +++ b/src/lib/holocene/input/input.svelte @@ -74,8 +74,10 @@ let testId = $$props['data-testid'] || id; - function callFocus(input: HTMLInputElement) { - if (autoFocus && input) input.focus(); + let inputRef: HTMLInputElement | null = null; + + function handleFocus() { + inputRef?.focus(); } const dispatch = createEventDispatcher(); @@ -93,25 +95,28 @@
{#if icon} {/if} + 0 ? maxLength : undefined} {placeholder} {id} @@ -120,16 +125,10 @@ {required} {autocomplete} bind:value - on:click|stopPropagation - on:input - on:keydown|stopPropagation - on:change - on:focus - on:blur - use:callFocus data-testid={testId} {...$$restProps} /> + {#if copyable}