Skip to content

Fix inline Submit button sitting below the inputs with frm_flex submit HTML - #3613

Open
vivi-the-going-merry[bot] wants to merge 1 commit into
masterfrom
fix/issue-6894-inline-submit-flex
Open

vivi-the-going-merry[bot] wants to merge 1 commit into
masterfrom
fix/issue-6894-inline-submit-flex

Conversation

@vivi-the-going-merry

Copy link
Copy Markdown
Contributor

Fixes Strategy11/formidable-pro#6894

What was broken

With Submit Button Position set to Inline and top labels, the Submit button sat 17px below the inputs when the form used the default submit HTML (<div class="frm_submit frm_flex">). Forms with the old <div class="frm_submit"> lined up fine.

The hidden ::before spacer is a flex item in the wrapping frm_flex row, so it no longer sits above the button. align-items: center then centers the button against the spacer.

What changed

css/custom_theme.css.php: for an inline submit that uses frm_flex, the spacer takes a full row and the items start at the top with no row gap. order: -2 keeps the spacer first when Pro puts Previous (order: -1) in the same row.

How it was verified

Lite + Pro in a local preview env, forms with two frm4 fields and the inline submit. Button top minus input top:

before after
default HTML, 1400px 17.05px 0px
default HTML, 700px 17.05px 0px
old HTML (frm_submit) 0px 0px

Before:

before

After:

after

Multi-page form, page 2 (Previous + Submit), top offset from the input top. Before: Previous -26px, Submit 37.8px. After: Previous 0px, Submit 34px. They stack because the cell is narrow; that is the same before and after.

multi-page after

No automated test: frm_flex only becomes a flex row with Pro active, and Lite's CI has no Pro.

🤖 Generated with Claude Code

The ::before spacer was a flex item in the wrapping row and the button was
centered against it. Make the spacer a full row and pin items to the top.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@deepsource-io

deepsource-io Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in a0b9742...df6754b on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
PHP Oct 23, 2026 2:13a.m. Review ↗
JavaScript Oct 23, 2026 2:13a.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@franky-the-going-merry franky-the-going-merry Bot added the franky-working Franky is actively reviewing this label Oct 23, 2026

@franky-the-going-merry franky-the-going-merry Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. The fix works and I reproduced it live. One small non-blocking note on row-gap: 0, inline below.

Repro (Lite master vs. this PR, Pro active, two frm4 fields, top labels, inline submit, default frm_submit frm_flex HTML): button top minus input top was 17.05px on master and is 0px on this branch. At 1400px and 700px wide. The old frm_submit markup stays at ~0px both before and after. Computed styles on the branch: spacer flex-basis: 100%, order: -2; wrapper align-items: flex-start, row-gap: 0.

After, single page:

after

After, multi-page form page 2 (Previous top 0px, Submit 34px; they stack because the cell is narrow, same as before the PR):

multi-page after

Not exercised: the second selector (frm_inline_submit in the submit HTML without frm_inline_top), and non-default Style settings. Checked by reading it, not rendering it. Psalm is red, but master's last two runs are red too (stripe/ files, nothing in this diff).

Comment thread css/custom_theme.css.php
.with_frm_style .frm_submit.frm_flex.frm_inline_submit {
align-items: flex-start;
align-content: flex-start;
row-gap: 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking. row-gap: 0 also removes the ~1.9px gap that used to separate Previous and Submit when they wrap onto two rows. On page 2 of a multi-page form I measured the stacked buttons as 0px apart after this PR (the screenshot above shows them touching). The 0 is needed to keep the spacer from pushing the buttons down, so if you want the separation back, put it on the buttons instead, for example a small margin-bottom on .frm_prev_page inside this selector scope. Fine to leave if you'd rather not touch it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving it. A margin-bottom on the Previous button would also grow the row in the common side-by-side layout, and the 2px only showed up when the buttons wrap, which is the narrow-cell case that stacked before too.

@franky-the-going-merry franky-the-going-merry Bot added vivi-pickup and removed franky-review franky-working Franky is actively reviewing this labels Oct 23, 2026
@vivi-the-going-merry vivi-the-going-merry Bot added vivi-working Vivi is actively working this franky-review and removed vivi-pickup vivi-working Vivi is actively working this labels Oct 23, 2026
@franky-the-going-merry franky-the-going-merry Bot added the franky-working Franky is actively reviewing this label Oct 23, 2026
@franky-the-going-merry

Copy link
Copy Markdown
Contributor

Agreed, leaving row-gap: 0 as is. The 2px only appears when the buttons wrap in a narrow cell, which already stacked before this PR, and a margin on Previous would grow the common side-by-side row. My Approve at df6754b stands.

@franky-the-going-merry franky-the-going-merry Bot removed franky-review franky-working Franky is actively reviewing this labels Oct 23, 2026
@Crabcyborg Crabcyborg added this to the 7.1 milestone Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant