Skip to content

[IRN-6372] [BpkBottomSheet] - aria title read on Android TalkBack#4175

Draft
Stephen Hailey (steviehailey-skyscanner) wants to merge 1 commit intomainfrom
IRN-6372
Draft

[IRN-6372] [BpkBottomSheet] - aria title read on Android TalkBack#4175
Stephen Hailey (steviehailey-skyscanner) wants to merge 1 commit intomainfrom
IRN-6372

Conversation

@steviehailey-skyscanner
Copy link
Contributor

Remember to include the following changes:

  • Ensure the PR title includes the name of the component you are changing so it's clear in the release notes for consumers of the changes in the version e.g [Clover-123][BpkButton] Updating the colour
  • README.md (If you have created a new component)
  • Component README.md
  • Tests
  • Accessibility tests
    • The following checks were performed:
      • Ability to navigate using a keyboard only
      • Zoom functionality (Deque University explanation):
        • The page SHOULD be functional AND readable when only the text is magnified to 200% of its initial size
        • Pages must reflow as zoom increases up to 400% so that content continues to be presented in only one column i.e. Content MUST NOT require scrolling in two directions (both vertically and horizontally)
      • Ability to navigate using a screen reader only
  • Storybook examples created/updated
  • For breaking changes or deprecating components/properties, migration guides added to the description of the PR. If the guide has large changes, consider creating a new Markdown page inside the component's docs folder and link it here

@skyscanner-backpack-bot
Copy link

Visit https://backpack.github.io/storybook-prs/4175 to see this build running in a browser.

@skyscanner-backpack-bot
Copy link

Warnings
⚠️

Package source files (e.g. packages/package-name/src/Component.js) were updated, but snapshots weren't. Have you checked that the tests still pass?

Browser support

If this is a visual change, make sure you've tested it in multiple browsers.

Generated by 🚫 dangerJS against 3a078cc

export type Props = CommonProps & ({ ariaLabelledby: string } | { ariaLabel: string; });

const getContentStyles = (paddingStyles: PaddingStyles): string => {
const {

Choose a reason for hiding this comment

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

No change here - linter seems to have hoovered up some old trailing spaces

);

const headingId = `bpk-bottom-sheet-heading-${id}`;
const headingIsHidden = !title && 'ariaLabel' in ariaProps;

Choose a reason for hiding this comment

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

Detect if we're in the situation where we only have a heading for ScreenReader purposes to describe the dialog (no visual title)

<header className={getClassName('bpk-bottom-sheet--header-wrapper')}>
<BpkNavigationBar
id={headingId}
id={headingIsHidden ? `bpk-bottom-sheet-title-hidden-${id}` : headingId}

Choose a reason for hiding this comment

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

Since we adding a Screen Reader heading below using headingId we don't want to pass the same id to Nav Bar and risk a duplicated element id inside with the same id so use an alternative in this case.

/>
{/* non-visible header element required for Android TalkBack to announce ariaLabel when no title provided on open BottomSheet */}
{headingIsHidden && (
<BpkVisuallyHidden as="h2">

Choose a reason for hiding this comment

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

Same heading level as NavBar normally uses for visual Bottom Sheet title (when it has one)

Tested on Android with TalkBack via "No Header" story and now we do get the aria title announced on open while still maintaining focus on the close button. ✅

@steviehailey-skyscanner Stephen Hailey (steviehailey-skyscanner) changed the title [IRN-6372] BpkBottomSheet - aria title read on Android TalkBack [IRN-6372] [BpkBottomSheet] - aria title read on Android TalkBack Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution patch Patch production bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants