From 415058d7d8dfcc1c7d884da75bf64eef3d9bce12 Mon Sep 17 00:00:00 2001 From: Samuel Prevost Date: Fri, 1 May 2026 00:00:29 +0200 Subject: [PATCH] fix(datums): dot-decimal inputs, gate Next on validity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dimension inputs (width, height, length, diameter) were `type="number"`, which let some browsers reinterpret comma-locale input ("21,5") as 21.5 under the hood. Switch to `type="text" inputmode="decimal"` and parse strictly with `Number()` so only dot-decimal ("21.5") is treated as the intended fraction; "21,5" produces NaN and is flagged. A small per-field raw-input buffer remembers the literal string the user typed so an invalid intermediate state ("21,") doesn't get rendered as "NaN" on the next reactive pass. The buffer is dropped automatically when the stored value diverges from `Number(buffered)` — i.e. when an external mutation (preset button, rect-dim swap) changes the datum. Visual: invalid fields get a red border + ring. Functional gate: `canProceedToStep4` now also checks `Number.isFinite(...)` so a NaN dimension prevents Next from being clickable, matching the user's "prevent Next unless it's a number" requirement. --- src/components/DatumPanel.vue | 109 ++++++++++++++++++++++++++-------- src/stores/app.ts | 13 +++- 2 files changed, 94 insertions(+), 28 deletions(-) diff --git a/src/components/DatumPanel.vue b/src/components/DatumPanel.vue index 809408e..ea3b2fb 100644 --- a/src/components/DatumPanel.vue +++ b/src/components/DatumPanel.vue @@ -1,4 +1,5 @@