Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions css/custom_theme.css.php
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,19 @@
}
<?php } ?>

.with_frm_style .frm_inline_submit_button{
position: relative;
}

.with_frm_style .frm_inline_submit_button .frm_submit{
position: absolute;
bottom: 0;
}

.with_frm_style .frm_inline_submit_button .frm_submit .frm_button_submit{
margin-bottom: 0;
}
Comment on lines +611 to +613
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.

⚠️ Potential issue | 🟡 Minor

margin-bottom: 0 is overridden by the existing !important rule when frm_center_submit is present.

The rule at lines 660–664 sets margin-bottom: 8px !important on .frm_center_submit .frm_submit button. Because !important wins regardless of specificity, any form that combines frm_center_submit with an inline submit button that receives frm_inline_submit_button will retain the 8 px margin, nullifying the intent of this rule.

🔧 Proposed fix
 .with_frm_style .frm_inline_submit_button .frm_submit .frm_button_submit{
-	margin-bottom: 0;
+	margin-bottom: 0 !important;
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.with_frm_style .frm_inline_submit_button .frm_submit .frm_button_submit{
margin-bottom: 0;
}
.with_frm_style .frm_inline_submit_button .frm_submit .frm_button_submit{
margin-bottom: 0 !important;
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@css/custom_theme.css.php` around lines 611 - 613, The rule ".with_frm_style
.frm_inline_submit_button .frm_submit .frm_button_submit { margin-bottom: 0; }"
is being overridden by the stronger ".frm_center_submit .frm_submit button {
margin-bottom: 8px !important; }"; update the inline-submit selector to win
(either by matching or exceeding specificity and/or adding !important) so
margin-bottom:0 actually applies when both classes are present—modify the
".with_frm_style .frm_inline_submit_button .frm_submit .frm_button_submit" rule
to use a higher-specificity selector or include !important to override
".frm_center_submit .frm_submit button".


.with_frm_style .frm_submit{
clear:both;
}
Expand Down
2 changes: 1 addition & 1 deletion js/formidable-settings-components.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/formidable-web-components.js

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions js/formidable.js
Original file line number Diff line number Diff line change
Expand Up @@ -1678,6 +1678,27 @@ function frmFrontFormJS() {
} );
}

function maybeUpdateInlineSubmitButtonLayout() {
const submitButtons = document.querySelectorAll( '.frm-show-form .frm_button_submit' );
if ( submitButtons.length === 0 ) {
return;
}

submitButtons.forEach( button => {
const submitContainer = button.closest( '.frm_form_field' );
const previousSibling = submitContainer.previousElementSibling;
if ( getTopPositionOfElement( submitContainer ) === getTopPositionOfElement( previousSibling ) ) {
// If the submit button is inline with other fields, vertically align it with other fields in the same row.
submitContainer.classList.add( 'frm_inline_submit_button' );
}
} );
}

function getTopPositionOfElement( element ) {
const rect = element.getBoundingClientRect();
return rect.top;
}

/**
* Destroys the formidable generated global hcaptcha object since it wouldn't otherwise render.
*/
Expand Down Expand Up @@ -1786,6 +1807,7 @@ function frmFrontFormJS() {
'frmPageChanged',
destroyhCaptcha
);
maybeUpdateInlineSubmitButtonLayout();
},

getFieldId,
Expand Down
Loading