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

Accessibility: Make aria-hidden for the canvas a patch setting. #929

Open
TobyKLight opened this issue Nov 27, 2024 · 6 comments
Open

Accessibility: Make aria-hidden for the canvas a patch setting. #929

TobyKLight opened this issue Nov 27, 2024 · 6 comments
Assignees

Comments

@TobyKLight
Copy link
Contributor

Request is to have a checkbox in patch settings that allows you to mark your <canvas> with the aria-hidden attribute.

Usecase is when your canvas is entirely decorative (e.g background of a website that does not contribute to content) and should not be announced by assistive technology.

More info on aria-hidden

@TobyKLight TobyKLight added the new label Nov 27, 2024
@pandrr
Copy link
Member

pandrr commented Nov 28, 2024

Screenshot 2024-11-28 at 09 27 08

we now have this accessibility op on dev.cables.gl which can set alt and aria-hidden for any html element.
could there more properties added ? let me know!

@pandrr
Copy link
Member

pandrr commented Nov 28, 2024

should this op also have a role parameter ?

what about aria-label ?

@pandrr pandrr removed the done label Nov 28, 2024
@TobyKLight
Copy link
Contributor Author

These were the accessibility properties I needed to make UIs so far on HTML, that I put on the HTMLElementExtended op.

  • Role attribute
  • Keyboard Focusable (tabindex)
    • Has an option to omit entirely, as this creates a third functionality that prevents an element can be focused with element.focus()
  • Aria-Disabled
  • Aria-LabelledBy
    • When blank it omits this attribute
  • Aria-DescribedBy
    • When blank it omits this attribute
  • Aria-Label
    • Has a separate checkbox to enable because you may intentionally want a blank aria-label to specify an element is decorative.
  • Aria-Description
    • Has a separate checkbox to enable because you may intentionally want a blank aria-description (theoretically)
  • Aria-Hidden

Note the HTMLElementExtended op allows you to set any tag as well so you can make instead of

. But you may need both as there are more accessible roles than HTML tag types.

screenshot of the properties of HTMLElementExtended op discussed above

@TobyKLight
Copy link
Contributor Author

Note also with the ElementAccessibility op as it is currently: only <img> elements support the alt attribute. Better I think to just add alt as a property to the ImageElement op.

aria-label and aria-labelledby attributes are the way to provide alt text for most element types. (But not all... See the MDN article for details)

@pandrr
Copy link
Member

pandrr commented Dec 2, 2024

btw. there is now a elementSetAttribute operator, which can be used to set all those aria attributes

@pandrr
Copy link
Member

pandrr commented Dec 2, 2024

hey,
maybe you could take the current Ops.Html.ElementAccessibility op and add your accessibility stuff to it ?

pull request highly appreciated :)

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

No branches or pull requests

3 participants