question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

V5 Offcanvas - Option to disable auto hide when offcanvas loses focus.

See original GitHub issue

Currently 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:closed
  • Created 2 years ago
  • Reactions:6
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
rajesh2kumar96commented, Apr 10, 2021

#33605 @GeoSot Please review this PR and if anything is left let me know.

https://deploy-preview-33605--twbs-bootstrap.netlify.app/

1reaction
scoizzlecommented, May 14, 2021

I would say that the new behavior is what would be desirable and is an acceptable alternative to what I suggested.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Offcanvas · Bootstrap v5.0
Use the buttons below to show and hide an offcanvas element via JavaScript that toggles the .show class on an element with the...
Read more >
Bootstrap 5 offcanvas scrolls back to top on close
It seems like that the button that is used to open the offcanvas gets the focus back. I tried something like this. var...
Read more >
Offcanvas · Boosted v5.2
Use the buttons below to show and hide an offcanvas element via JavaScript that toggles the .show class on an element with the...
Read more >
readme.txt
... aria-hidden attribute * Tweak: Remove/add aria-hidden to off-canvas on toggle ... off-canvas panel * Fix: Focus slideout toggle when closing off-canvas ......
Read more >
Max Mega Menu – WordPress dodatak
Automatic support for native touch events; Off Canvas Mobile Menu option built ... Menu item options including Hide Text, Disable Link, Hide on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found