Repository navigation
fix: Enter no longer submits when the submit button is hidden, and goes to the next step in multi-part forms (6.4.x) - #266
Closed
RensTillmann wants to merge 2 commits into
Closed
RensTillmann wants to merge 2 commits into
RensTillmann wants to merge 2 commits into
Conversation
…conditional logic (6.4.x)
… step instead of submitting (6.4.x)
Owner
Author
|
The fix is already released in 6.4.010 (release PR #299, merged 21 Oct 2026): src/assets/js/frontend/elements.js (Enter handler, around lines 1651-1677) makes Enter follow the step's visible Next button on non-final steps and only submit through a visible, non-read-only submit button. This PR's test file tests/test-enter-key-client.cjs was not part of that release and stays on this branch. The browser suite covers this on 6.4.010 (enter-key.spec.ts, 4 tests passed). |
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.
Summary
Pressing Enter in a field submitted the form even when the submit button was hidden by conditional logic (for example inside a Column whose conditions hide it). The Enter handler in
elements.jstook the first submit button withquerySelectorand never checked visibility; the server accepted the submission.Now the handler uses the first submit button that is not inside a conditionally hidden parent (
SUPER.has_hidden_parent); if none is visible, Enter does nothing. Multi-part behaviour, the disable-enter setting and buttons in invisible columns are unchanged.LTS counterpart: separate PR.
Base branch
release/6.4.x: bug fix.Tests
Found during QA, not changed here: Enter in a filled step-1 field of a multi-part form submits the whole form from step 1 (same on released builds).
Merge
Draft: for QA and the next release session.
Update: Enter in multi-part forms
Second commit (approved behaviour change): in a multi-part form, Enter on a step that is not the last now clicks that step's own Next button (
SUPER.switchMultipartwith the step's validation) instead of submitting the whole form from step 1. On the last step Enter submits as before (first visible submit button). If the active step's Next button is hidden, or the step has no Next button, Enter does nothing (it never skips steps). Tests: tests/test-enter-key-client.cjs, 4 new multi-part cases fail on the previous code and pass now; all client tests pass.