Skip to content

feat(modal, popover): add ability to temporarily disable focus trapping - #29379

Merged
liamdebeasi merged 11 commits into
feature-8.1from
FW-4694
Apr 25, 2024
Merged

liamdebeasi merged 11 commits into
feature-8.1from
FW-4694

Conversation

@liamdebeasi

@liamdebeasi liamdebeasi commented Apr 23, 2024 •

Copy link
Copy Markdown
Contributor

Issue number: resolves #24646


What is the current behavior?

Ionic's focus trapping ensures that focus does not move outside of overlays. However, it only recognizes Ionic overlays (ion-modal, ion-popover, etc) as valid overlays. This means presenting a 3rd party overlay from an Ionic overlay is challenging to do because focus never moves to the 3rd party overlay. Developers have requested more control over the focus trapping behavior so they can use 3rd party overlays. By giving developers more control over when focus trapping applies, they will be able to ensure that focus can move from an Ionic overlay to a 3rd party overlay.

What is the new behavior?

  • Added a property to modal and popover that disabled focus trapping. In the property documentation I made it clear that this should only be used so developers can manually move focus to another overlay. Disabling focus trapping when not doing this can cause a11y issues.

Does this introduce a breaking change?

  • Yes
  • No

Other information

Dev build: 8.0.0-dev.11712850753.10c4a960

@vercel

vercel Bot commented Apr 23, 2024 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ionic-framework ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 24, 2024 9:24pm

@github-actions github-actions Bot added the package: core @ionic/core package label Apr 23, 2024
@liamdebeasi liamdebeasi changed the title Fw 4694 feat(modal, popover): add ability to temporarily disable focus trapping Apr 23, 2024
@github-actions github-actions Bot added the package: vue @ionic/vue package label Apr 23, 2024
@liamdebeasi
liamdebeasi marked this pull request as ready for review April 23, 2024 19:51
@liamdebeasi
liamdebeasi requested a review from a team as a code owner April 23, 2024 19:51
@liamdebeasi
liamdebeasi requested review from averyrousseau and removed request for averyrousseau April 23, 2024 19:51

@thetaPC thetaPC left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, works well! Just minor request.

Comment thread core/src/components/modal/modal.tsx Resolved
Comment thread core/src/components/popover/popover.tsx Resolved

This branch was successfully deployed

1 active deployment
Preview — 4444f9a4 Deployed Apr 24, 2024 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: core @ionic/core package package: vue @ionic/vue package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants