Merge pull request #2864 from webmin/dev/fix-button-row-forms
Some checks failed
Tests / prove (push) Has been cancelled
Package and upload artifacts / build (push) Has been cancelled
Close inactive / close-inactive (push) Has been cancelled

Fix button row forms crossing table rows
This commit is contained in:
Jamie Cameron
2026-10-02 16:44:33 -07:00
committed by GitHub
2 changed files with 17 additions and 3 deletions

View File

@@ -613,7 +613,14 @@ tr.ui_buttons_row > td {
border-top: 1px solid var(--border-color-lighter);
vertical-align: middle;
}
tr.ui_buttons_row:first-child > td { border-top: 0; }
/* Each row is a form with a table of its own, as a form cannot wrap table
* rows. Flattening the wrappers lets all rows share the outer columns */
tr.ui_buttons_form_row,
tr.ui_buttons_form_row > td,
form.ui_buttons_form,
form.ui_buttons_form > table,
form.ui_buttons_form > table > tbody { display: contents; }
tr.ui_buttons_form_row:first-child tr.ui_buttons_row > td { border-top: 0; }
td.ui_buttons_label {
width: 1%;
padding-right: 16px;

View File

@@ -1880,8 +1880,13 @@ $postmethod ||= 'post';
if (ref($hiddens)) {
$hiddens = join("\n", map { &ui_hidden(@$_) } @$hiddens);
}
return "<form action='$script' class='ui_buttons_form' method='$postmethod'>\n".
# A form cannot wrap table rows, so each row is a full-width cell holding
# the form, which wraps a table of its own
return "<tr class='ui_buttons_form_row'><td colspan='2' style='padding:0'>\n".
"<form action='$script' class='ui_buttons_form' method='$postmethod'>\n".
$hiddens.
"<table width='100%' cellspacing='0'>\n".
"<tr class='ui_buttons_row".($disabled ? " disabled" : "")."'> ".
"<td nowrap".($singlecell ? " colspan='2'" : " width='20%'").
" valign='top' class='ui_buttons_label'>".
@@ -1892,7 +1897,9 @@ return "<form action='$script' class='ui_buttons_form' method='$postmethod'>\n".
"<td width='80%' valign='top' class='ui_buttons_value'>".
$desc."</td>\n").
"</tr>\n".
"</form>\n";
"</table>\n".
"</form>\n".
"</td></tr>\n";
}
=head2 ui_buttons_hr([title])