Skip to content

fix(core): clear reflected ARIA attrs from host after sync - #31660

Merged
ShaneK merged 3 commits into
ionic-team:mainfrom
masimplo:fix/31659-button-aria-label-host-clear
Nov 12, 2026
Merged

ShaneK merged 3 commits into
ionic-team:mainfrom
masimplo:fix/31659-button-aria-label-host-clear

Conversation

@masimplo

@masimplo masimplo commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Issue number: resolves #31659


What is the current behavior?

Currently, an aria-label written to ion-button after load is copied to the native button but also left on the host, so VoiceOver on iOS stops on both. Angular's [attr.aria-label] does this every time the binding changes. ion-item and ion-card behave the same way.

What is the new behavior?

Once an aria-label, aria-description or role written after load is copied, we replace it on the host with an empty string. That leaves the host without a name, and since the attribute is still there, removing it later still clears the native element. Other attributes stay on the host as before, and ion-button now syncs a role written after load too.

A non-clickable ion-card or ion-item keeps the label on the host, because it has no native element that can carry it.

Does this introduce a breaking change?

  • Yes
  • No

Other information

Post-load aria-label writes were copied onto the native control but left on
the host, so VoiceOver exposed ion-button twice. Clear the host after each
reflect, matching the initial inherit.

Resolves ionic-team#31659

Co-authored-by: Cursor <[email protected]>
@masimplo
masimplo requested a review from a team as a code owner October 27, 2026 11:52
@masimplo
masimplo requested a review from thetaPC October 27, 2026 11:52
@vercel

vercel Bot commented Oct 27, 2026

Copy link
Copy Markdown

@masimplo is attempting to deploy a commit to the Ionic Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the package: core @ionic/core package label Oct 27, 2026
@ShaneK
ShaneK requested review from ShaneK and removed request for thetaPC October 27, 2026 12:56
ShaneK
ShaneK previously requested changes Oct 27, 2026

@ShaneK ShaneK left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for this, the double announcement goes away with this change! Removing a label that was set after load doesn't clear it from the button anymore though, so an Angular [attr.aria-label] bound to null leaves the old name behind. The rest are small cleanups inline.

Comment thread core/src/utils/attribute-controller.ts Resolved
Comment thread core/src/components/button/button.tsx Resolved
Comment thread core/src/utils/attribute-controller.ts Resolved
@vercel

vercel Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
ionic-framework Ready Ready Preview Nov 12, 2026 8:24pm UTC

Request Review

@ShaneK
ShaneK dismissed their stale review November 10, 2026 23:05

I'm taking over maintenance of this PR

@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

# Conflicts:
#	core/src/components/button/button.tsx
#	core/src/components/card/card.tsx
#	core/src/components/item/item.tsx
#	core/src/utils/attribute-controller.ts
#	core/src/utils/test/attribute-controller.spec.ts
@ShaneK
ShaneK added this pull request to the merge queue Nov 12, 2026
Merged via the queue into ionic-team:main with commit 850f8c7 Nov 12, 2026
56 checks passed
Shalom-Borohov added a commit to Shalom-Borohov/prayer-log that referenced this pull request Nov 26, 2026
Ionic 9.0.12 (ionic-team/ionic-framework#31660) moves an aria-label
written after load from the ion-button host onto the native button in
its shadow root and leaves the host with an empty aria-label, so
VoiceOver stops once. buttonByLabel queried the host attribute and lost
every button whose label changes after the first render.

The helper now matches the label on the shadow button or link, and the
settings gear's absence check uses it too, so it can't pass vacuously.
Shalom-Borohov added a commit to Shalom-Borohov/prayer-log that referenced this pull request Nov 26, 2026
* chore(deps): bump the npm group across 1 directory with 11 updates

Bumps the npm group with 11 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [@hebcal/core](https://github.com/hebcal/hebcal-es6) | `6.14.7` | `6.16.1` |
| [@ionic/react](https://github.com/ionic-team/ionic-framework) | `9.0.9` | `9.0.12` |
| [@ionic/react-router](https://github.com/ionic-team/ionic-framework) | `9.0.9` | `9.0.12` |
| [@cloudflare/workers-types](https://github.com/cloudflare/workerd) | `5.20261118.1` | `5.20261119.1` |
| [@testing-library/user-event](https://github.com/testing-library/user-event) | `14.6.8` | `14.6.13` |
| [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/tree/HEAD/packages/plugin-react) | `6.1.2` | `6.3.0` |
| [fake-indexeddb](https://github.com/dumbmatter/fakeIndexedDB) | `6.2.6` | `6.2.8` |
| [oxlint](https://github.com/oxc-project/oxc/tree/HEAD/npm/oxlint) | `1.90.0` | `1.94.0` |
| [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) | `8.3.5` | `8.3.8` |
| [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) | `5.0.5` | `5.1.1` |
| [wrangler](https://github.com/cloudflare/workers-sdk/tree/HEAD/packages/wrangler) | `4.164.0` | `4.165.0` |



Updates `@hebcal/core` from 6.14.7 to 6.16.1
- [Release notes](https://github.com/hebcal/hebcal-es6/releases)
- [Commits](hebcal/hebcal-es6@v6.14.7...v6.16.1)

Updates `@ionic/react` from 9.0.9 to 9.0.12
- [Release notes](https://github.com/ionic-team/ionic-framework/releases)
- [Changelog](https://github.com/ionic-team/ionic-framework/blob/main/CHANGELOG.md)
- [Commits](ionic-team/ionic-framework@v9.0.9...v9.0.12)

Updates `@ionic/react-router` from 9.0.9 to 9.0.12
- [Release notes](https://github.com/ionic-team/ionic-framework/releases)
- [Changelog](https://github.com/ionic-team/ionic-framework/blob/main/CHANGELOG.md)
- [Commits](ionic-team/ionic-framework@v9.0.9...v9.0.12)

Updates `@cloudflare/workers-types` from 5.20261118.1 to 5.20261119.1
- [Release notes](https://github.com/cloudflare/workerd/releases)
- [Changelog](https://github.com/cloudflare/workerd/blob/main/RELEASE.md)
- [Commits](https://github.com/cloudflare/workerd/commits)

Updates `@testing-library/user-event` from 14.6.8 to 14.6.13
- [Release notes](https://github.com/testing-library/user-event/releases)
- [Changelog](https://github.com/testing-library/user-event/blob/main/CHANGELOG.md)
- [Commits](testing-library/user-event@v14.6.8...v14.6.13)

Updates `@vitejs/plugin-react` from 6.1.2 to 6.3.0
- [Release notes](https://github.com/vitejs/vite-plugin-react/releases)
- [Changelog](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite-plugin-react/commits/[email protected]/packages/plugin-react)

Updates `fake-indexeddb` from 6.2.6 to 6.2.8
- [Release notes](https://github.com/dumbmatter/fakeIndexedDB/releases)
- [Changelog](https://github.com/dumbmatter/fakeIndexedDB/blob/master/CHANGELOG.md)
- [Commits](dumbmatter/fakeIndexedDB@v6.2.6...v6.2.8)

Updates `oxlint` from 1.90.0 to 1.94.0
- [Release notes](https://github.com/oxc-project/oxc/releases)
- [Changelog](https://github.com/oxc-project/oxc/blob/main/npm/oxlint/CHANGELOG.md)
- [Commits](https://github.com/oxc-project/oxc/commits/oxlint_v1.94.0/npm/oxlint)

Updates `vite` from 8.3.5 to 8.3.8
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v8.3.8/packages/vite)

Updates `vitest` from 5.0.5 to 5.1.1
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Changelog](https://github.com/vitest-dev/vitest/blob/main/docs/releases.md)
- [Commits](https://github.com/vitest-dev/vitest/commits/v5.1.1/packages/vitest)

Updates `wrangler` from 4.164.0 to 4.165.0
- [Release notes](https://github.com/cloudflare/workers-sdk/releases)
- [Commits](https://github.com/cloudflare/workers-sdk/commits/[email protected]/packages/wrangler)

---
updated-dependencies:
- dependency-name: "@cloudflare/workers-types"
  dependency-version: 5.20261119.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: "@hebcal/core"
  dependency-version: 6.16.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: "@ionic/react"
  dependency-version: 9.0.12
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: "@ionic/react-router"
  dependency-version: 9.0.12
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: "@testing-library/user-event"
  dependency-version: 14.6.13
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: "@vitejs/plugin-react"
  dependency-version: 6.3.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: fake-indexeddb
  dependency-version: 6.2.8
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: oxlint
  dependency-version: 1.94.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: vite
  dependency-version: 8.3.8
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: vitest
  dependency-version: 5.1.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: wrangler
  dependency-version: 4.165.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <[email protected]>

* test: find Ionic buttons by their native button's label (#97)

Ionic 9.0.12 (ionic-team/ionic-framework#31660) moves an aria-label
written after load from the ion-button host onto the native button in
its shadow root and leaves the host with an empty aria-label, so
VoiceOver stops once. buttonByLabel queried the host attribute and lost
every button whose label changes after the first render.

The helper now matches the label on the shadow button or link, and the
settings gear's absence check uses it too, so it can't pass vacuously.

* test: wait for the report sheet's status region (#97)

With jsdom 31 the report sheet's role="status" region can still be
inaccessible for a moment after the description field shows, while the
sheet presents, so a one-shot getByRole failed about one run in four.
findByRole waits for it.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Shalom-Borohov <[email protected]>

This branch was successfully deployed

1 active deployment
Preview — 10b1ed52 Deployed Nov 12, 2026 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: ion-button post-load aria-label stays on host and native control (duplicate VoiceOver stop)

3 participants