Skip to content

Commit 9f7fb2a

Browse files
GeoSotmdo
authored andcommitted
Help offcanvas follow Css responsiveness
1 parent b96cf5a commit 9f7fb2a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

js/src/offcanvas.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,14 @@ class Offcanvas extends BaseComponent {
185185
this.hide()
186186
}
187187
})
188+
189+
EventHandler.on(window, 'resize', () => {
190+
// Add this check to help js be aligned with css changes on responsive offcanvas
191+
if (this._isShown && getComputedStyle(this._element).position !== 'fixed') {
192+
// this._backdrop.hide()
193+
this.hide()
194+
}
195+
})
188196
}
189197

190198
// Static

0 commit comments

Comments
 (0)