Skip to content

fix(segment): expose tab position metadata - #31431

Open
Mahesh5R wants to merge 1 commit into
ionic-team:mainfrom
Mahesh5R:fix/segment-aria-position
Open

fix(segment): expose tab position metadata#31431
Mahesh5R wants to merge 1 commit into
ionic-team:mainfrom
Mahesh5R:fix/segment-aria-position

Conversation

@Mahesh5R

@Mahesh5R Mahesh5R commented Sep 6, 2026

Copy link
Copy Markdown

Issue number: resolves #31282


What is the current behavior?

Screen readers may not correctly announce the position and total count of
ion-segment-button tabs.

The native elements with role="tab" are rendered within each segment
button's Shadow DOM, so assistive technologies may not reliably infer the
position of each tab within the segment.

What is the new behavior?

ion-segment now calculates the position and total number of its segment
buttons and provides that information to each ion-segment-button.

The native button with role="tab" now exposes:

  • aria-posinset
  • aria-setsize

The values are recalculated when segment buttons are dynamically added or
removed.

Does this introduce a breaking change?

  • Yes
  • No

Other information

Added regression tests covering:

  • ARIA position/count for initially rendered segment buttons
  • dynamically adding a segment button
  • dynamically removing a segment button and recalculating remaining positions

The existing Shadow DOM structure is unchanged.

Validation completed successfully:

  • targeted segment tests
  • TypeScript lint
  • Sass lint
  • Prettier
  • production build

@Mahesh5R
Mahesh5R requested a review from a team as a code owner September 6, 2026 14:50
@vercel

vercel Bot commented Sep 6, 2026

Copy link
Copy Markdown

@Mahesh5R 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 Sep 6, 2026
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-segment): screen readers fail to announce correct tab count/position due to ARIA tablist hierarchy

1 participant