Skip to content

Conversation

joselrio
Copy link
Contributor

@joselrio joselrio commented Jul 21, 2025

Issue number: resolves #30040


What is the current behavior?

  • The usage of aria-hidden="true" attributes both on overlay and picker components was causing some console error/warnings messages.
  • This was being caused due the fact of the activeElement (focused element) was inside those elements with this attribute that's equal to true in all cases.

d13215a4-a610-4b1f-81d8-ce3ae05df790

What is the new behavior?

  • There is no need of making usage of this attribute due the facts:

    1. Once overlay is closed the focus will be redirect to the element that triggers the overlay, this way screen readers will be also redirected to the same context of focused element.
    1. After overlay is closed, it will be set as a display: none; through the selector :host(.overlay-hidden), which by itself will disable overlay content for the screen readers.
  • Removed overlay tests since they were basically checking about aria-hidden attribute.

  • Updated PickerColumn and PickerColumnOption structure in order to fit the a11y needs.

  • Added a focus management system to better drive users when making usage of keyboard navigation inside picker.

  • Skip A11Y test validation when reported violation is color contrast related.

⚠️ NOTE:

  • Reported devTools issue/warning when selecting picker is from now on expected due to focus an input that's set with tabIndex="-1" and aria-hidden="true" - Which turns into an A11Y violation when it gets focused.
    It happens that it gets focused dynamically in order to open the native numeric keyboard once user selects highlighted picker values zone, in order to allow users to insert numeric values through the keyboard.
    If this aria-hidden and tabindex are removed/updated, the existing functionality will be lost since ScreenReaders will start to ignore the updated value through the PickerChange and will be focused onto the focused input.
    This mentioned input has an onChange event that's used to update the aria-valuetext on each picker-column which is being capture by the ScreenReader.
    That said, this new devTools reported issue/warning is a false positive since A11Y behaviour is being covered through a different perspective.

Does this introduce a breaking change?

  • Yes
  • No

Testing:

Other Information

Dev build: 8.7.4-dev.11756388042.1a103a79

@joselrio joselrio requested a review from a team as a code owner July 21, 2025 11:24
Copy link

vercel bot commented Jul 21, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
ionic-framework Ready Ready Preview Comment Sep 3, 2025 6:34pm

@github-actions github-actions bot added the package: core @ionic/core package label Jul 21, 2025
@joselrio joselrio added the a11y Accessibility related issues label Jul 21, 2025
@danielehrhardt
Copy link
Contributor

lgtm, please merge

@brandyscarney brandyscarney changed the title fix(overlay and picker): remove aria-hidden attribute fix(overlay,picker): remove invalid aria-hidden attribute Sep 2, 2025
@brandyscarney brandyscarney changed the title fix(overlay,picker): remove invalid aria-hidden attribute fix(overlays,picker): remove invalid aria-hidden attribute Sep 2, 2025
Copy link
Member

@brandyscarney brandyscarney left a comment

Choose a reason for hiding this comment

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

Great work! 🚀 A couple minor changes requested for the a11y tests and I will post the results of my testing in Jira.

joselrio and others added 2 commits September 3, 2025 09:40
…mn-option.e2e.ts

Co-authored-by: Brandy Smith <brandyscarney@users.noreply.github.com>
Co-authored-by: Brandy Smith <brandyscarney@users.noreply.github.com>
joselrio and others added 2 commits September 3, 2025 19:30
…mn-option.e2e.ts

Co-authored-by: Brandy Smith <brandyscarney@users.noreply.github.com>
Co-authored-by: Brandy Smith <brandyscarney@users.noreply.github.com>
@joselrio joselrio enabled auto-merge September 3, 2025 18:31
@joselrio joselrio added this pull request to the merge queue Sep 3, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 3, 2025
@joselrio joselrio added this pull request to the merge queue Sep 3, 2025
Merged via the queue into main with commit 49f96d7 Sep 3, 2025
51 checks passed
@joselrio joselrio deleted the ROU-11368-to-main branch September 3, 2025 23:04
github-merge-queue bot pushed a commit that referenced this pull request Sep 24, 2025
Issue number: resolves #30684

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->
Recently, we [fixed some issues with aria-hidden in
modals](#30563),
unfortunately at this time we neglected modals that opt out of focus
trapping. As a result, a lot of modals that disable focus trapping still
have it happening and it doesn't get cleaned up properly on dismiss.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->
We're now properly checking for and skipping focus traps on modals that
do not want them.

## Does this introduce a breaking change?

- [ ] Yes
- [X] No

<!--
  If this introduces a breaking change:
1. Describe the impact and migration path for existing applications
below.
  2. Update the BREAKING.md file with the breaking change.
3. Add "BREAKING CHANGE: [...]" to the commit description when merging.
See
https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer
for more information.
-->


## Other information

I created regression tests for Angular in this to prevent this from
happening again. I initially tried to do this with core, but the issue
doesn't seem to reproduce with core.

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

Current dev build:
```
 8.7.5-dev.11758652700.103435a3
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a11y Accessibility related issues package: angular @ionic/angular package package: core @ionic/core package package: react @ionic/react package package: vue @ionic/vue package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: Accessibility issue - ion-popover has aria-hidden error when dismissed
4 participants