Skip to content

Accessibility: Button pressed state and lists#940

Open
tskarhed wants to merge 3 commits into
wojtekmaj:mainfrom
tskarhed:tskarhed/table-a11y
Open

Accessibility: Button pressed state and lists#940
tskarhed wants to merge 3 commits into
wojtekmaj:mainfrom
tskarhed:tskarhed/table-a11y

Conversation

@tskarhed

Copy link
Copy Markdown

Fixes #613 by adding a pressed state to the button.

Also adds lists for displaying, so a screen reader may know which item number you are currently at.

Preferably it would use tables and support arrow key navigation, as mentioned in #887, but that requires quite a lot of refactoring which will result in breaking changes.

@tskarhed

Copy link
Copy Markdown
Author

@wojtekmaj Is there anything else you need from me to make this happen?

Comment thread packages/react-calendar/src/Tile.tsx Outdated
onMouseOver={onMouseOver ? () => onMouseOver(date) : undefined}
style={style}
type="button"
aria-pressed={!!classes?.find((classString) => classString.indexOf('--active') != -1 || classString.indexOf('--hasActive') != -1)}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This is the easiest way I could figure out how to check for the selected state.

@tvkarambelas

tvkarambelas commented Dec 19, 2024

Copy link
Copy Markdown

hi @wojtekmaj I'm interested in the status of this PR as well. The issue that this PR is fixing blocks my ability to use the library in a project. Is this something that's intended to be merged in the near future?

@kzunino

kzunino commented Dec 19, 2024

Copy link
Copy Markdown

I, too, am interested in this fix.

@tskarhed

Copy link
Copy Markdown
Author

@wojtekmaj I am not quite sure how these changes are affecting the failing tests

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.

A11y: Add "aria-pressed" attribute to tile buttons

3 participants