-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Use 'role' = button for chip navigation #8011
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This pull request adds the 'role' attribute with the value 'button' to the Chip component's StyledContainer, improving accessibility for assistive technologies.
- Added 'role: "button"' to StyledContainer's type definition in
packages/twenty-ui/src/display/chip/components/Chip.tsx
- Included 'role="button"' prop in the JSX of StyledContainer
- Addresses accessibility concern raised in issue Use
<a>
orrole=button
for Chip Navigation #7817 for Chip navigation - Potential improvement: Consider using
<a>
element for navigation items as suggested in the issue - Note: Further accessibility enhancements may be needed, such as keyboard navigation support
1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
@@ -133,6 +133,7 @@ export const Chip = ({ | |||
size={size} | |||
variant={variant} | |||
onClick={onClick} | |||
role="button" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Consider conditionally applying role='button' only when onClick is provided
I'm not sure about the proposed change. I would like to examine the initial problem and consider another solution. We should be using a Let's keep this work on stand-by and think about another solution. |
Thanks! At least now Thomas will be able to use Vimium |
Closes #7817
Added role attribute to the div element of the Chip component. This assigns the role of "button" to the container, which is important for accessibility. It indicates that this div should be treated as a button by assistive technologies like screen readers.