Skip to content

Commit

Permalink
Help offcanvas follow Css responsiveness
Browse files Browse the repository at this point in the history
  • Loading branch information
GeoSot authored and mdo committed Feb 25, 2022
1 parent b96cf5a commit 9f7fb2a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions js/src/offcanvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9f7fb2a

Please sign in to comment.