fix(forms): keep inline validation errors rendering on empty submit #410
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
psa-systems/mokosh-apps!410
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/MAPPS-347-form-validation-inline-errors"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
dfb12cbadded two shared handlers to the Input component's element that always installed regardless of whether the call site opted in:onkeydown: move |e| props.onkeydown.call(e)(default no-op) andonmounted: move |e| { if props.autofocus { spawn(...) } }. Both were meant to be backward-compatible passthroughs for GlobalSearch's collapse-on-click expand pattern (autofocus the entry, Escape to collapse). In practice, installing them on every Input instance broke the inline-error rendering path on the ticket-create form: submitting an empty form set title_error to "Title is required." but the corresponding<p class="text-red-600">slot never rendered, which took mokosh-server's form-validation.spec.ts red on staging (PMS-518 AC7). MAPPS-347 tracks the regression.Isolate the fix to the two files
dfb12cbtouched:autofocusandonkeydownprops from InputProps and stop installing the two always-on handlers on the underlying<input>element. Every existing consumer (dozens of forms across the SPA) reverts to the pre-dfb12cb behavior that PMS-518 was built against.use_effectgated on theexpanded()signal that grabs the input by id and callsHtmlElement::focus()after commit. Escape lives on the wrapper div'sonkeydown(keydown bubbles up from the focused input, same pattern the modal uses on its container).The mokosh-server-side test.fixme that PMS-591 landed to un-block its own merge un-fixmes in a matching PR once this SPA fix ships.
#MAPPS-347