Repository navigation
Fix inline Submit button sitting below the inputs with frm_flex submit HTML #3613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
df6754b
e404c85
9af2a45
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -287,6 +287,24 @@ public function test_get_all() { | |
| $this->assertSame( FrmStylesController::$post_type, reset( $styles )->post_type ); | ||
| } | ||
|
|
||
| /** | ||
| * With the default "frm_submit frm_flex" submit HTML, the inline submit label spacer must take a full row | ||
| * and the button must not be vertically centered against it. | ||
| * | ||
| * @see https://github.com/Strategy11/formidable-pro/issues/6894 | ||
| */ | ||
| public function test_generated_css_aligns_inline_flex_submit_with_inputs() { | ||
| $css = $this->run_private_method( | ||
| array( new FrmStyle(), 'get_css_content' ), | ||
| array( FrmAppHelper::plugin_path() . '/css/custom_theme.css.php' ) | ||
| ); | ||
| $submit_selector = '.with_frm_style.frm_inline_top .frm_submit.frm_flex,.with_frm_style .frm_submit.frm_flex.frm_inline_submit'; | ||
| $spacer_selector = '.with_frm_style.frm_inline_top .frm_submit.frm_flex::before,.with_frm_style .frm_submit.frm_flex.frm_inline_submit::before'; | ||
|
|
||
| $this->assertStringContainsString( $submit_selector . ' {align-items: flex-start;', $css ); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| $this->assertStringContainsString( $spacer_selector . ' {flex-basis: 100%;order: -2;}', $css ); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| } | ||
|
|
||
| /** | ||
| * The CSS version must be a zero-padded timestamp so distinct save times | ||
| * never collide (e.g. 1 Jan 10:59 and 11 Jan 00:59 both produced "111059"). | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking.
row-gap: 0also 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 smallmargin-bottomon.frm_prev_pageinside this selector scope. Fine to leave if you'd rather not touch it.There was a problem hiding this comment.
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.