diff --git a/js/src/offcanvas.js b/js/src/offcanvas.js index 2735a9c2aeac..71af990902db 100644 --- a/js/src/offcanvas.js +++ b/js/src/offcanvas.js @@ -185,6 +185,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