-
Notifications
You must be signed in to change notification settings - Fork 148
Feature/accessibility #363
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
Feature/accessibility #363
Conversation
CLA Assistant Lite bot: I have read the CLA Document and I hereby sign the CLA 1 out of 2 committers have signed the CLA. |
Thanks @Zankel-Engineering for spending time on this PR. First of all, headless component must apply all the correct ARIA roles and attributes in order to be considered Second, I've reviewed it and I think there's an eaiser way to handle this - Qwik has a type called Plus in Qwik, unlike React, we can use What we can do is to either destructure the props from all the specific event listeners we don't want to override like I've written an example of a mix of both here:
We need to make sure that each component has this behavior by default (some of the componets like tabs and accordion has this already) If you can, please update your PR and also make sure you fill out the CLA following these insturctions to make the bot happy :) Let me know if you need any assitance Thanks again for your contribution! |
Thanks @Zankel-Engineering ! About the CLA, if you manually udpated the file, you need to undo it and instead reply the following words here (so it'll do it automatically) - Thanks |
|
||
export const PopoverTrigger = component$( | ||
(props: ExtendedPropsByAriaAttribute) => { | ||
(props: ExtendedPropsByAriaAttribute<'span'>) => { |
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.
What are the benefits of using ExtendedPropsByAriaAttribute
compared to QwikIntrinsicElements
which alredy has aria attributes built in?
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.
That's good thinking to cover the case, but I think it's more relevant to react code.
Wrote in my other answer why.
store.ariaAttributes = ariaAttributes; | ||
store.lastKey = lastKey; | ||
ariaAttributesStore.ariaAttributes = ariaAttributes; | ||
ariaAttributesStore.lastKey = lastKey; |
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'm not sure why do we need an extra store, we can spread the props over the element itself instead (like we do in the tabs or accordion) which will remove the unnecessary management code.
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.
but in Qwik it's not an issue, people are not suppose to write their attributes with snake case or camel etc, only kebab, just like standard HTML
Thanks again @Zankel-Engineering ! I've added a few comments to illustrate better what I meant in my last reply, I think we can leverage the already existing aria attributes handling that Qwik has instead of duplicating it. Let me know what you think |
@all-contributors please add @Zankel-Engineering for code, tests, bug, and a11y |
I've put up a pull request to add @Zankel-Engineering! 🎉 |
What is it?
Description
Adding accessibility-feature for screen readers to the popover trigger. Can be extended to other components and is not bound from typing where what is possible yet.
Use cases and why
Screenshots/Demo
See in the examples
Checklist: