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

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