From 22cad32a2d359f0554b43c5c05a3f631451dacc9 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}