V5 Offcanvas - Option to disable auto hide when offcanvas loses focus.
See original GitHub issueCurrently in v5.0.0-beta 3:
Offcanvas will autohide when it loses focus. IE you click anywhere other than the offcanvas area.
What I’m suggesting:
Add data-bs-autohide boolean value to config options for Offcanvas. Default for data-bs-autohide is true; to maintain existing compatibility.
Disable event registration for EVENT_CLICK_DISMISS when data-bs-autohide is set to false.
Alternatively, to allow changing of this property via the data attribute, allow the event to still be registered, but change the event handler to respect the autohide property.
Examples of the modifications required to implement change follow.
` const Default = { backdrop: true, keyboard: true, scroll: false, autohide: true }
const DefaultType = { backdrop: ‘boolean’, keyboard: ‘boolean’, scroll: ‘boolean’, autohide: ‘boolean’ } `
if (!this._config.autohide) { EventHandler.on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, () => this.hide()) }
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:7 (4 by maintainers)
Top GitHub Comments
#33605 @GeoSot Please review this PR and if anything is left let me know.
https://deploy-preview-33605--twbs-bootstrap.netlify.app/
I would say that the new behavior is what would be desirable and is an acceptable alternative to what I suggested.