diff options
author | GeoSot <geo.sotis@gmail.com> | 2022-02-25 01:11:48 +0300 |
---|---|---|
committer | Mark Otto <markdotto@gmail.com> | 2022-02-25 03:41:01 +0300 |
commit | 9f7fb2aab5c281dcc6dedfadde70872ce3a8a7bb (patch) | |
tree | dcb22bd2733db1289738647ed32f7692622167cc | |
parent | b96cf5aacb7cc9b7b9de2c76e78b688bec4b3f3a (diff) |
Help offcanvas follow Css responsiveness
-rw-r--r-- | js/src/offcanvas.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/js/src/offcanvas.js b/js/src/offcanvas.js index 2735a9c2ae..71af990902 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 |