Repository navigation
fix(validate): report a committed pick's change at once on hosts - #127
Merged
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On a NoJS-Server compiled site, the validate host backend debounced every form
input/changeevent by 300 ms (FACTS_DEBOUNCE_MS) and kept the submit buttons enabled while a dispatch was waiting. Core's validate directive re-validates onchangeimmediately (src/validate/element.js, form-levelinputHandleronchange). So when a checkbox drives a field'svalidate-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: achangeevent 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, notype) keeps the debounce. Itschangefires on blur, together with afocusoutthat already reports.Tests
__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*.spec.ts,ui-host.spec.ts): 269/270 passed. The one failure isvalidation-load-order.spec.tson Firefox. It is flaky: a different variant failed on each repeat. That spec runs core pages, sohost.jsis 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-submitis disabled aftervalidate-ifmakes the due date required, as in core. The NoJS-Server parity fixturevalidate-if-modelpasses 3/3 against this branch and is marked pending until this merges (NoJS-Serverfix/acceptance-batch-3).