diff --git a/js/src/offcanvas.js b/js/src/offcanvas.js index 0ae5dbfda..359a024f3 100644 --- a/js/src/offcanvas.js +++ b/js/src/offcanvas.js @@ -206,6 +206,14 @@ class Offcanvas extends BaseComponent { this.hide() }) + + EventHandler.on(window, 'resize', () => { + // Add this check to help js be aligned with css changes on responsive offcanvas + if (this._isShown && getComputedStyle(this._element).position !== 'fixed') { + // this._backdrop.hide() + this.hide() + } + }) } // Static