Skip to content

Commit

Permalink
Fix: Bootstrap 5 when used with ES imports wasn't displaying the modal
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanJard committed Mar 26, 2024
1 parent b573bda commit 5e187b2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions js/responsive.bootstrap5.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ DataTable.Responsive.bootstrap = function (bs) {
};

_display.modal = function (options) {
if (!modal) {
if (!modal && _bs.Modal) {
modal = new _bs.Modal(_modal[0]);
}

return function (row, update, render, closeCallback) {
if (!$.fn.modal) {
if (! modal) {
return _original(row, update, render, closeCallback);
}
else {
Expand All @@ -59,8 +59,7 @@ _display.modal = function (options) {
_modal
.data('dtr-row-idx', row.index())
.one('hidden.bs.modal', closeCallback)
.appendTo('body')
.modal();
.appendTo('body');

modal.show();
}
Expand Down

0 comments on commit 5e187b2

Please sign in to comment.