2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-05-15 11:59:39 +03:00

Help offcanvas follow Css responsiveness

This commit is contained in:
GeoSot
2022-02-25 00:11:48 +02:00
committed by Mark Otto
parent b96cf5aacb
commit 9f7fb2aab5
+8
View File
@@ -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