2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-05-21 13:24:08 +03:00

Add responsive offcanvas classes

- Updates navbar-expand classes to de-dupe some styles—these shouldn't interfere now.
- Adds some JS to the offcanvas component to help with responsiveness

Co-Authored-By: GeoSot <geo.sotis@gmail.com>
This commit is contained in:
Mark Otto
2022-02-28 17:20:55 -08:00
parent 3990ff04a0
commit 9b7759ff37
+8
View File
@@ -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