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

Add support for aria-label on Widgets #463

Open
scmmmh opened this issue Nov 11, 2022 · 3 comments
Open

Add support for aria-label on Widgets #463

scmmmh opened this issue Nov 11, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@scmmmh
Copy link
Contributor

scmmmh commented Nov 11, 2022

Problem

I started looking into fixing jupyterlab/jupyterlab#13045, which requires the aria-label to be set on various widgets, so that screen readers can announce the landmarks correctly. After looking at the source for a bit and asking for some feedback, it became clear that the issue could be addressed more generally at the upstream lumino Widget level.

Proposed Solution

I'm not that familiar with the lumino source yet, but the way I see it, the solution is to add an ariaLabel (not sure how hyphenated attributes are generally transformed into JS attributes in lumino) property to the Widget.IOptions and then the Widget can ensure that the the necessary HTML attributes are generated. Obviously not all Widgets will have an ariaLabel set, so it needs to be optional, in particular since for some Widgets ariaLabeledBy may be more appropriate.

Alternatively the "role" attribute solution could be re-used, making individual Widgets responsible for generating the aria-label attributes. However, that creates a lot of code-duplication (and I would be more inclined to suggest a second feature request to refactor that "role" support into the main Widget).

Additional context

Because I'm new to the lumino code-base, I will need some guidance, but I'm happy to contribute a PR to actually implement this.

@scmmmh scmmmh added the enhancement New feature or request label Nov 11, 2022
@welcome
Copy link

welcome bot commented Nov 11, 2022

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@scmmmh
Copy link
Contributor Author

scmmmh commented Nov 14, 2022

I've now spent a bit more time with the source code and can see the reason for having it devolved into those widgets that need it and not having it in general as an option. So at this point I would really just want to start a discussion of whether to move this into the Widget or to leave as it is, in which case I would address the original JupyterLab issue in the JupyterLab codebase.

@fcollonval
Copy link
Member

Hey @scmmmh thanks for starting this discussion.

I agree with you to not make in a general option because then people may start to want more and more aria attributes as part of the JavaScript API. Moreover it may enter in conflict for element that are labelled by another one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants