-
Notifications
You must be signed in to change notification settings - Fork 82
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
KButton: Add aria-haspopup and aria-expanded for dropdown menus #856
base: develop
Are you sure you want to change the base?
Conversation
Thank you @josephinoo! Let me invite my colleague @akolson for review. @akolson would you also coordinate and confirm with @radinamatic please? @radinamatic here's where you can test dropdown https://deploy-preview-856--kolibri-design-system.netlify.app/buttons/#dropdowns |
docs/pages/kbutton.vue
Outdated
@@ -26,6 +26,23 @@ | |||
<KButton text="Secondary flat button" :primary="false" appearance="flat-button" /> | |||
</KButtonGroup> | |||
</DocsShow> | |||
<p> |
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.
I appreciate you think of documentation @josephinoo. I wonder whether we need to mention this in the docs though since many KDS components have a11 baked in, and generally from a user-developer point of view, there's no need to know the details.
@radinamatic any thoughts about this? https://deploy-preview-856--kolibri-design-system.netlify.app/kbutton/ this is the new section
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.
Thank you, @MisRob, for the feedback! You make a good point about the built-in accessibility features. I can remove the explicit documentation about ARIA attributes, since they work automatically without developer intervention. The focus should be on the component's functionality rather than its internal accessibility implementation. Let me update the PR accordingly.
hi @josephinoo is this pr still a work in progress, or we can proceed to review it -- I see it's still in draft? |
Hi @akolson, Can you review it ? |
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.
Code changes look great. Thanks @josephinoo. I'll add a little blocker as we await feedback about the documentation pieces from @radinamatic. We should be clear after this. Thanks again
Hi @josephinoo! Can you please rebase your branch on top of the latest KDS develop? We recently updated the KDS nodejs version to v18 and vue to v2.7, and we need to do the rebase for the actions to run successfully :). There are also new linting rules, so after rebasing, please run |
40df99a
to
421a745
Compare
f81d4b9
to
27a9978
Compare
Can you check it again @akolson?. I had to update the code for edge cases :) |
Description
This PR enhances KButton accessibility by adding ARIA dropdown attributes. When KButton is used with a dropdown menu, it now automatically includes aria-haspopup="menu" and manages aria-expanded state for improved screen reader feedback and navigation.
Issue addressed
Reported by @AlexVelezLl in #832
Before/after screenshots
Changelog
Description: Adds aria-haspopup and aria-expanded attributes to KButton when used with dropdown menus to improve screen reader feedback
Products impact: Anhancement
Addresses: [KButton]: Add aria-haspopup and aria-expanded to KButton when it has a KDropdownMenu related #832
Components: KButton
Breaking: no
Impacts a11y: yes
Guidance: WNo changes required for existing implementations. The ARIA attributes are automatically added when KButton is used with dropdown menus through the menu slot.
Steps to test
aria-haspopup="menu"
is presentaria-expanded
changes from "false" to "true"Testing checklist
Reviewer guidance