From 9f7fb2aab5c281dcc6dedfadde70872ce3a8a7bb Mon Sep 17 00:00:00 2001 From: GeoSot Date: Fri, 25 Feb 2022 00:11:48 +0200 Subject: [PATCH] Help offcanvas follow Css responsiveness --- js/src/offcanvas.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/js/src/offcanvas.js b/js/src/offcanvas.js index 2735a9c2a..71af99090 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