From 96470a604a5d3c8e8c0dbd500fc93e5391ed1e27 Mon Sep 17 00:00:00 2001 From: Jennie Robinson Faber Date: Tue, 19 May 2026 12:19:35 +0100 Subject: [PATCH] fix(natural-date-input): preserve input on edit, use reliable update event MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two reliability bugs in the natural-language date input: 1. Clicking Edit on a saved-date pill and changing the value immediately re-showed the saved value. clearAndEdit pre-fills the input with the formatted saved date so the admin doesn't start over, but chrono parses that string on the very first keystroke, re-sets parsedDate, and the auto-hide template flips the pill back. Added an isEditing flag that keeps the input visible across re-parses and clears on blur once we have a valid parse. 2. Typing "tomorrow at 2pm" sometimes committed "tomorrow at ". UInput's template spreads \$attrs onto the inner alongside its own @input="onInput", and Vue's listener-array merge intermittently drops the fall-through @input mid-typing — in the reproduction, the final 'm' never reached parseNaturalInput, so chrono's last successful read was "tomorrow at 2p" matching just "tomorrow". Switched to @update:model-value (a declared emit on UInput, so it goes through the reliable component-emit path) and made onBlur always re-parse the final value as a backup. --- app/components/NaturalDateInput.vue | 30 +++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/app/components/NaturalDateInput.vue b/app/components/NaturalDateInput.vue index a1f814c..187c034 100644 --- a/app/components/NaturalDateInput.vue +++ b/app/components/NaturalDateInput.vue @@ -1,8 +1,8 @@