From 876ec44d11a2b87a779f0ade2fc02d52eef32641 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 1 Feb 2021 14:10:55 +0000 Subject: [PATCH] Update date picker to fix horrible flatpickr event handling --- .../src/forms/DateTimeField.svelte | 31 ++++++++++++++++--- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/packages/standard-components/src/forms/DateTimeField.svelte b/packages/standard-components/src/forms/DateTimeField.svelte index e4beda5d3e..591acededb 100644 --- a/packages/standard-components/src/forms/DateTimeField.svelte +++ b/packages/standard-components/src/forms/DateTimeField.svelte @@ -37,7 +37,9 @@ // duplicate input field. // We need to blur both because the focus styling does not get properly // applied. - const els = document.querySelectorAll(`#${$fieldState.id}-wrapper input`) + const els = document.querySelectorAll( + `#${$fieldState.fieldId}-wrapper input` + ) els.forEach(el => el.blur()) } @@ -51,9 +53,9 @@ on:close={onClose} options={flatpickrOptions} on:change={handleChange} - element={`#${$fieldState.id}-wrapper`}> + element={`#${$fieldState.fieldId}-wrapper`}>
-
+
+ {#if open} +
+ {/if} {/if}