From c28feb378cbf72e1c6e2cb9e0a1046a0ac925afb Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Sun, 28 Jan 2024 22:25:29 -0600 Subject: [PATCH] Update the date and time inputs to open on click The default behavior is to open only when clicking the icon, but it may be difficult to click such a small icon. This change updates the input so that the picker opens when the input is clicked. --- src/lib/elements/forms/inputDate.svelte | 3 +++ src/lib/elements/forms/inputTime.svelte | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/elements/forms/inputDate.svelte b/src/lib/elements/forms/inputDate.svelte index 380abe2793..f0849b2225 100644 --- a/src/lib/elements/forms/inputDate.svelte +++ b/src/lib/elements/forms/inputDate.svelte @@ -75,6 +75,9 @@ bind:value bind:this={element} on:invalid={handleInvalid} + on:click={function () { + this.showPicker(); + }} style:--amount-of-buttons={isNullable ? 2.75 : 1} style:--button-size={isNullable ? '2rem' : '1rem'} /> {#if isNullable} diff --git a/src/lib/elements/forms/inputTime.svelte b/src/lib/elements/forms/inputTime.svelte index bc30b8745d..cb224bf18b 100644 --- a/src/lib/elements/forms/inputTime.svelte +++ b/src/lib/elements/forms/inputTime.svelte @@ -59,7 +59,10 @@ class="input-text" bind:value bind:this={element} - on:invalid={handleInvalid} /> + on:invalid={handleInvalid} + on:click={function () { + this.showPicker(); + }} /> {#if error} {error}