Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 11 commits into from
Apr 25, 2024

Conversation

liamdebeasi
Copy link
Contributor

@liamdebeasi liamdebeasi commented Apr 23, 2024

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

Copy link

vercel bot commented Apr 23, 2024

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
Copy link
Contributor

@thetaPC thetaPC left a comment

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.

core/src/components/modal/modal.tsx Outdated Show resolved Hide resolved
core/src/components/popover/popover.tsx Outdated Show resolved Hide resolved
liamdebeasi and others added 4 commits April 24, 2024 17:16
Co-authored-by: Maria Hutt <thetaPC@users.noreply.github.com>
Co-authored-by: Maria Hutt <thetaPC@users.noreply.github.com>
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