fix: regression in grid button hiding logic

This commit is contained in:
Sagar Vora 2026-03-01 10:05:09 +05:30
parent 911f5f9e42
commit e4dad7323b
3 changed files with 8 additions and 6 deletions

View file

@ -24,7 +24,7 @@ frappe.ui.form.on("Recorder", {
});
let index_grid = frm.fields_dict.suggested_indexes.grid;
index_grid.wrapper.find(".grid-footer").toggle(true);
index_grid.wrapper.find(".grid-footer").toggleClass("hidden", false);
index_grid.toggle_checkboxes(true);
index_grid.df.cannot_delete_rows = true;
index_grid.add_custom_button(__("Add Indexes"), function () {

View file

@ -671,9 +671,11 @@ export default class Grid {
this.wrapper.find(".grid-footer").addClass("hidden");
}
// don't be tempted to use the `.hidden` class here
// it is used in other logic for the same buttons and will cause conflicts
this.wrapper
.find(".grid-add-row, .grid-add-multiple-rows, .grid-upload")
.toggleClass("hidden", !is_editable);
.toggleClass("d-none", !is_editable);
}
setup_fields() {

View file

@ -142,10 +142,6 @@ body {
-webkit-transform: translate(-50%, -50%);
}
.hide {
display: none !important;
}
.btn-link {
box-shadow: none !important;
outline: none;
@ -159,6 +155,10 @@ body {
@extend .d-none;
}
.hide {
@extend .d-none;
}
.margin {
margin: var(--margin-sm);
}