Skip to content

fix(validate): report a committed pick's change at once on hosts - #127

Merged
ErickXavier merged 1 commit into
mainfrom
fix/validate-host-change-immediate
Nov 20, 2026
Merged

ErickXavier merged 1 commit into
mainfrom
fix/validate-host-change-immediate

Conversation

@ErickXavier

Copy link
Copy Markdown
Collaborator

On a NoJS-Server compiled site, the validate host backend debounced every form input/change event by 300 ms (FACTS_DEBOUNCE_MS) and kept the submit buttons enabled while a dispatch was waiting. Core's validate directive re-validates on change immediately (src/validate/element.js, form-level inputHandler on change). So when a checkbox drives a field's validate-if, core disables the submit in the same interaction; the compiled site enabled it and only disabled it 300 ms later.

Change

src/validate/host.js: a change event from a select, or from an input that is not a text-entry type (checkbox, radio, date, range, color, ...), now reports at once (immediate).

Text entry (text, search, email, url, tel, password, number, no type) keeps the debounce. Its change fires on blur, together with a focusout that already reports.

Tests

  • New unit test in __tests__/validate-host.test.js: a committed pick (checkbox, select, date) reports immediately, and the waiting text input is flushed first.
  • npm test: 835 passed, 5 skipped.
  • Validation/host e2e (validation*.spec.ts, ui-host.spec.ts): 269/270 passed. The one failure is validation-load-order.spec.ts on Firefox. It is flaky: a different variant failed on each repeat. That spec runs core pages, so host.js is not loaded.
  • dist/ is rebuilt and committed (version check OK, 1.23.0).

Downstream

NoJS-Server acceptance journey j6c-wizard, step 4: with this branch, #new-submit is disabled after validate-if makes the due date required, as in core. The NoJS-Server parity fixture validate-if-model passes 3/3 against this branch and is marked pending until this merges (NoJS-Server fix/acceptance-batch-3).

On compiled sites the validate host debounced every input/change by
300 ms and kept the submit buttons enabled meanwhile. Core re-validates
on change at once, so a checkbox that a validate-if reads disables the
submit in the same interaction. A change from a checkbox, radio,
select, date or other non-text control now reports immediately; text
entry keeps the debounce (its change comes with a reporting focusout).
@ErickXavier
ErickXavier merged commit 63f3578 into main Nov 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant