-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 Block: Add HTML Element selection in Advanced settings (accessibility) #63534
Comments
Note: The Buttons block already supports using the |
Yes this feels more like an education and documentation issue.
|
Yes, I didn't even know this was possible. 😅 Is there an explicit reason why there is no UI for this? |
Yes, to prevent users from setting it to the button element by mistake or doing it wrong. |
This is also why we need the block reference to list all the available block supports and block attributes in a searchable way. |
I have a hard time with this response. If we want to make it easier for people to build accessible websites without having to write code, there should be a UI for it and in-editor documentation that explains the difference between a button and a link to educate users on what to choose. If it's only available via the interactivity API, the vast majority of people will not know how to do it. They'll continue using the button block to create click-triggered modals (which a non-dev can do with a plugin like Popup Maker). |
Without user testing, there is no way to know which would be the higher risk. |
If they set it to a button and then didn't connect it to something else (either with a plugin or custom code), it would not do anything, right? Theoretically, they would notice that clicking it does nothing when testing their website. Based on my auditing, a misused link is more likely than a misused button. And the misused link happens all the time. |
I'd also be happy to remove the word button from the block title and name it to something else, but I figure that's already been discussed and is a nonstarter. |
I am not sure how to move forward with this.
|
The challenge here is that people are already misusing the current "button" block because they don't understand that it cannot be used to create an HTML button and there is a way to "fake" a button by linking to just a hash. Adding the ability to set a The problem with the current block is that the misuse How about this for helper text? Here are possible articles that could be linked to for the more link:
|
I'm inclined to agree with @amberhinds - this block is already heavily misused. I have personally encountered button blocks with no href attribute in numerous audits, and so there is no question that the block is actively misused as it is. If we do not want to make it possible to use a However, I don't think that being able to convert this into a I do think that if we add the Overall, my concerns are more about the fact that this can create an |
I'll chime in here and say as someone who both develops sites and helpw our clients maintain them 99% of our clients do not know that groups have an option to be It's fine that it's doable through code, but essentially hard for us to deploy especially on sites where the content has been created over several years of use on a site where we could make their buttons accessible, just by switching the mark-up on given blocks, but also teaching users how it's done, so they can do it retroactively. Having this option would help us as developers immensely and not affect most of the user base in any way or form. |
What problem does this address?
Currently, the Button block only outputs links. Users frequently misinterpret its name. They use the "button" block to trigger modals and other elements that should be triggered by a true HTML button, not a link. This adds accessibility problems to websites, particularly for screen reader users.
Additionally, there are instances where users add groups of links with the button block that should be contained in an HTML list or that function like navigation and should be contained in an HTML nav tag.
These three things are issues that I frequently encounter while accessibility auditing websites built with the block editor. The current solution is to replace core blocks with custom blocks or to write Javascript to remediate the issues. We need to make it easier for users to avoid or fix accessibility issues in a no-code way.
What is your proposed solution?
This block would be greatly enhanced with the addition of several dropdowns in the advanced section that allow developers and more advanced content creators to adjust the markup of the link itself and surrounding markup.
Something similar to the HTML element dropdown on the Group block
This is what we would need:
<a>
default<button>
<div>
default<ul>
<div>
default<nav>
If a nav tag is set for the parent container, we need to give users the ability to add an
aria-label
so there would need to be a text field that conditionally appears.The text was updated successfully, but these errors were encountered: