Skip to content

Fix/accessibility labels#127

Merged
Macacoazul01 merged 3 commits intoMacacoazul01:masterfrom
gabrielezereik:fix/accessibility-labels
Feb 26, 2026
Merged

Fix/accessibility labels#127
Macacoazul01 merged 3 commits intoMacacoazul01:masterfrom
gabrielezereik:fix/accessibility-labels

Conversation

@gabrielezereik
Copy link
Contributor

Add semantics support for header navigation arrows

This PR adds accessibility support to the header navigation arrows by introducing two new optional parameters in PickerHeaderSettings:
previousButtonSemanticsLabel — semantic label for the "previous" arrow button
nextButtonSemanticsLabel — semantic label for the "next" arrow button
These labels are passed down to a Semantics widget wrapping each IconButton in HeaderArrows, with button: true and excludeSemantics: true to ensure screen readers announce the custom label instead of the default "icon" description.

Motivation

Without explicit semantics, screen readers (e.g. TalkBack, VoiceOver) would announce the arrows as "icon", providing no meaningful context to visually impaired users. With this change, developers can provide localized, descriptive labels for these controls.
Usage

MonthPickerDialogSettings(
  headerSettings: PickerHeaderSettings(
    previousButtonSemanticsLabel: 'Previous month',
    nextButtonSemanticsLabel: 'Next month',
  ),
)

@Macacoazul01
Copy link
Owner

Tks for the PR. Just gonna check something about the semantics widget and then merge

@Macacoazul01 Macacoazul01 merged commit 8496dcc into Macacoazul01:master Feb 26, 2026
@Macacoazul01
Copy link
Owner

@gabrielezereik im gonna add it to the library without changing the default fallback for now (MaterialLocalizations.of(context).nextMonthTooltip and previousMonthTooltip) and lets see if this causes a problem to someone's project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants