Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BpkCalendar] Accessibility roles #3699

Merged
merged 5 commits into from
Jan 13, 2025
Merged

[BpkCalendar] Accessibility roles #3699

merged 5 commits into from
Jan 13, 2025

Conversation

gert-janvercauteren
Copy link
Contributor

@gert-janvercauteren gert-janvercauteren commented Jan 2, 2025

BpkCalendar

Add the appropriate 'roles' to different components to make the calendar more accessible and easier to navigate for people using screen readers

You can play test the screen reader and keyboard interaction in the preview

  • Enabled grid navigation (Screen reader will announce that)
  • Removed aria-hidden of disabled date cells, it would mess up the grid structure.

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 [KOA-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

@gert-janvercauteren gert-janvercauteren added the patch Patch production bug label Jan 2, 2025
@gert-janvercauteren gert-janvercauteren self-assigned this Jan 2, 2025
Copy link

github-actions bot commented Jan 2, 2025

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

Copy link

github-actions bot commented Jan 2, 2025

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

Copy link

github-actions bot commented Jan 2, 2025

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

Copy link

github-actions bot commented Jan 2, 2025

Warnings
⚠️

Package source files (e.g. packages/package-name/src/Component.tsx) were updated, but type files weren't. Have you checked that no types have changed?

Browser support

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

Generated by 🚫 dangerJS against bd74da2

@gert-janvercauteren gert-janvercauteren marked this pull request as ready for review January 3, 2025 01:44
Copy link

github-actions bot commented Jan 3, 2025

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

@gert-janvercauteren gert-janvercauteren changed the title [WIP][BpkCalendar] Accessibility roles [BpkCalendar] Accessibility roles Jan 8, 2025
@@ -193,7 +193,6 @@ class BpkCalendarDate extends PureComponent<Props> {
type="button"
style={style}
className={classNames.join(' ')}
aria-hidden={isBlocked}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this might be causing the blocked dates in the scrollable calendar to be read by the screen reader which doesn't seem to be happening on the main branch 🤔

Copy link
Member

Choose a reason for hiding this comment

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

Agree with this point, currently the calendar wouldn't allow a AT user to go to dates that are in the past and make them inaccessible so with this removal this now allows them to select previous dates

Copy link
Member

Choose a reason for hiding this comment

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

I guess are we happy with users being able to get to that date and with it mentioning 'dimmed' this is ok?

Copy link
Contributor

Choose a reason for hiding this comment

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

Had a chat with Gert about this - it's not possible to keep this with the role of grid as it completely messes it up. Adding grid though brings a lot of benefits though like navigating up and down so even though you can now navigate through the blocked dates, it will be at most 30 days blocked, but you can just move down through the calendar so it's quick

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I purposefully unblocked the dimmed dates as otherwise, Grid navigation wouldn't work correctly :(

@olliecurtis olliecurtis merged commit 6766019 into main Jan 13, 2025
9 checks passed
@olliecurtis olliecurtis deleted the fix/calendar_a11y_roles branch January 13, 2025 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Patch production bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants