Skip to content

Commit 21af8d0

Browse files
committed
Add back fix for dropdown inside reponsive table
1 parent 848c020 commit 21af8d0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

webroot/js/local.js

+11
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,16 @@ var CrudView = {
8282
$('form[data-dirty-check=1]').dirtyForms();
8383
},
8484

85+
dropdown: function () {
86+
// recommended hack to get dropdowns correctly work inside responsive table
87+
$('.table-responsive').on('show.bs.dropdown', function () {
88+
$('.table-responsive').css('overflow', 'inherit');
89+
});
90+
$('.table-responsive').on('hide.bs.dropdown', function () {
91+
$('.table-responsive').css('overflow', 'auto');
92+
});
93+
},
94+
8595
tooltip: function () {
8696
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
8797
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl));
@@ -93,6 +103,7 @@ var CrudView = {
93103
this.select2('select[multiple]:not(.no-select2), select.select2');
94104
this.autocomplete('input.autocomplete, select.autocomplete');
95105
this.dirtyForms();
106+
this.dropdown();
96107
this.tooltip();
97108
}
98109
};

0 commit comments

Comments
 (0)