Skip to content

Commit 1684cfe

Browse files
committed
In enhance query form, remove the actions container if it becomes empty when removing the filter button
1 parent 465fdd5 commit 1684cfe

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

iommi/static/js/iommi.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,12 @@ class IommiBase {
363363
s.addEventListener('change', onChange);
364364
});
365365

366-
form.querySelector('[data-iommi-filter-button]').remove();
366+
const filterButton = form.querySelector('[data-iommi-filter-button]');
367+
const actionsContainer = filterButton.parentNode;
368+
filterButton.remove();
369+
if (actionsContainer.children.length === 0) {
370+
actionsContainer.remove();
371+
}
367372

368373
form.iommi = {
369374
getAjaxValidationUrl: function (params, endpoint) {

0 commit comments

Comments
 (0)