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

w3c Error: Attribute role not allowed on element label at this point. #259

Open
woolyseal opened this issue Aug 24, 2021 · 3 comments
Open

Comments

@woolyseal
Copy link
Member

The validation from w3c is throwing an Error with the following part in the common.py:

_opener_markup_template = (
u'<input id="navitem-{uid}" type="checkbox" class="opener" />'
u'<label for="navitem-{uid}" role="button" aria-label="{title}"></label>' # noqa: E 501
)

The Error says:
Error: Attribute role not allowed on element label at this point.

Is there any use for this "role" in the label? If not, I would fix this.

@woolyseal
Copy link
Member Author

I just did a fix and commited this in the branch iss259

@bmos
Copy link

bmos commented Mar 16, 2024

The point of that role is for people who need to use screen readers to browse the site.
It provides context so they know to expect an action when they click it.

@woolyseal
Copy link
Member Author

@bmos - Yes, I understand that there should be explaining attributes on it - but the "role" attributes seems a bit off for that. It should most likely be an aria-role or something like that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants