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

<button>s have accessibility and HTML validation issues #15222

Open
Psichorex opened this issue Feb 1, 2024 · 2 comments
Open

<button>s have accessibility and HTML validation issues #15222

Psichorex opened this issue Feb 1, 2024 · 2 comments

Comments

@Psichorex
Copy link
Contributor

Hi!

We are using HtmlValidation in our UI Tests at Lombiq at we often have to filter the output logs because they contain the following error logs:

  • Prefer to use the native element
  • must have accessible text
  • Redundant role "button" on

These warnings are all coming from OrchardCore's source html code. We could improve on these as these are kind of standard HTML validations.

Some examples:

<a role="button" class="nav-link dropdown-toggle" id="bd-theme" aria-expanded="false" data-bs-toggle="dropdown" data-bs-display="static" aria-label="@T["Toggle theme"]">

<a class="dropdown-toggle nav-link" id="navbarDropdown" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" role="button">

Also here is the search result for <a role="button"> https://github.com/search?q=repo%3AOrchardCMS%2FOrchardCore%20role%3D%22button%22&type=code

So we should convert <a role="button"> to <button>
I found somewhere a <button> with no text that triggers must have accessible text
Also found <button role="button">

Locations I found these are mainly the BlogTheme and the TheTheme.

@MikeAlhayek
Copy link
Member

MikeAlhayek commented Feb 2, 2024

So we should convert to

I believe it is okay to have a link with role="button" if we want the link to behave like a button but not when it is a clickable link.

is wrong, so if you find these issues a PR fixing them would be awesome.

I found somewhere a with no text that triggers must have accessible text

I think if you add title attribute the issue will be fixed.

I agree these should be fixed not ignored.

@MikeAlhayek MikeAlhayek added this to the 1.x milestone Feb 2, 2024
@Skrypt
Copy link
Contributor

Skrypt commented Feb 5, 2024

It needs to be fixed by the Bootstrap theme guy.

https://github.com/StartBootstrap/

I believe we just copy over the templates and adapt them with OC.
Else, every time we update them we need to re-fix these issues.

@Piedone Piedone changed the title Improving <button> elements in the HTML of Orchard Core <button>s have accessibility and HTML validation issues May 20, 2024
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

4 participants