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: Modal focus changes

See original GitHub issue

Skipping some previous v4-based PRs given our move to regular JS has already landed in master.

  • #25277: Modal tabbing and shift+tabbing behavior
  • #27646: Allow shift-tab focusing for modals
  • #25651: Modal input autofocus attr & keyboard nav
  • #21661: shift+tab without focused element within modal
  • #27241: SHIFT + TAB should cycle backwards

/cc @Johann-S

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
RyanBerlinercommented, Sep 30, 2020

Lots of mentions about TAB and SHIFT + TAB behavior in a couple issues, this seems to be the most current so hopefully its the correct spot.

I also agree that SHIFT + TAB should jump focus to the last focusable element in the modal when pressed with focus on the first focusable element. The recommended design pattern and keyboard support put out by w3c explains this as well. https://www.w3.org/TR/wai-aria-practices-1.1/examples/dialog-modal/dialog.html

Would this still be a welcomed change? Or is there a reason behind its current implementation?

The behavior I’ve described is present in v4, and v5, as seen on the doc pages. https://getbootstrap.com/docs/4.5/components/modal/ https://v5.getbootstrap.com/docs/5.0/components/modal/

0reactions
RyanBerlinercommented, Mar 14, 2021

I’d be glad to put in some time to submit a pr for this - first though I’d like to make sure that the bootstrap team is on board with doing this for v5, specifically following this proof of concept as a roadmap for implementing the desired behavior. I’d imagine as a follow up pr to resolving this issue, the same behavior should be inherited into the new Offcanvas component, using a similar inheritance pattern as the relationship between tooltips and popovers.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Modal · Bootstrap v5.0
Use Bootstrap's JavaScript modal plugin to add dialogs to your site for lightboxes, user notifications, or completely custom content.
Read more >
Bootstrap V5 manually call a modal myModal.show() not ...
The modal plugin toggles your hidden content on demand, via data attributes or JavaScript. It also adds .modal-open to the to override ...
Read more >
Modal · Boosted v5.1
Before getting started with Boosted's modal component, be sure to read the following as our menu options have recently changed. Modals are built...
Read more >
<Modal/> Component - React-Bootstrap
Modal's "trap" focus in them, ensuring the keyboard navigation cycles through the modal, and not the rest of the page. Unlike vanilla Bootstrap,...
Read more >
ion-modal: Ionic Mobile App Custom Modal API Component
A Modal is a dialog that appears on top of the app's content, and must be dismissed by the app before interaction can...
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