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

Allow aria attributes #2

Closed
rothsandro opened this issue Mar 24, 2022 · 5 comments · Fixed by #4 or #6
Closed

Allow aria attributes #2

rothsandro opened this issue Mar 24, 2022 · 5 comments · Fixed by #4 or #6
Assignees
Labels
package: hdot type: feature New feature or request

Comments

@rothsandro
Copy link

Is your feature request related to a problem? Please describe.
hdot should support ARIA attributes to improve accessibility of a site.

Describe the solution you'd like
ARIA Attributes should be supported similar to data attributes using camelCase.

h.button.ariaLabel('Close`)();

Describe alternatives you've considered
The only workaround right now is using [aria-xyz] which is not a very nice syntax (and no TS support):

h.button['aria-label']('Close')`button`,
@willmartian
Copy link
Owner

Thank you for the issue! Agreed, this is a very important feature the library is lacking and I am currently working on it for the next release.

@willmartian
Copy link
Owner

willmartian commented Mar 28, 2022

Hey @rothsandro, thanks again for the issue. Support for aria attributes was added in v0.0.5 here. Work still needs to be done to better document the type def and restrict possible aria attributes based on the role of the element, but this is a start!

@rothsandro
Copy link
Author

@willmartian Thanks 👍

In the following example dataTest works correct (generates data-test) but the aria attribute is added as arialabel instead of aria-label:

h.button.dataTest("123").ariaLabel("Hello")`Click Me`;

@willmartian
Copy link
Owner

Oops, that is my bad. Fixed this in v0.0.7 and added a unit test to cover myself in the future. You can find a link of your code snippet working properly here.

Thanks again for being an early tester of this project! :)

@rothsandro
Copy link
Author

Great, looks good now 🎉 Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: hdot type: feature New feature or request
Projects
Status: Done
2 participants