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 “title” attribute to the button block #59922

Closed
yglik opened this issue Mar 15, 2024 · 4 comments
Closed

Add “title” attribute to the button block #59922

yglik opened this issue Mar 15, 2024 · 4 comments
Labels
[Block] Buttons Affects the Buttons Block Needs Accessibility Feedback Need input from accessibility [Type] Enhancement A suggestion for improvement.

Comments

@yglik
Copy link

yglik commented Mar 15, 2024

Hi,
I would like the ability to add a “title” attribute to the button block.
so the html output will be:
<a href=“/nowhere” title=“awesome”>button text!</a>

as also described here
https://wordpress.org/support/topic/add-title-attribute-to-the-button-block/#post-17504173

The title attribute is a native tooltip, it’s good for accessibility and it’s a common attribute that I think should have a place in the core button block.

the implementation shouldn’t be difficult
It’s adding a block attribute and a hi that can be placed in the “extra” button in the block toolbar

IMG_0309

I would really appreciate insights and thoughts about this subject
Thanks

@yglik yglik added the [Type] Enhancement A suggestion for improvement. label Mar 15, 2024
@carolinan carolinan added Needs Accessibility Feedback Need input from accessibility [Block] Buttons Affects the Buttons Block labels Mar 17, 2024
@sahiladit
Copy link

Can you assign it to me?This is my first contribution can you reply me where can i get the code,so that i can edit it.

@t-hamano
Copy link
Contributor

Thanks for the report.

Previously, the button block had a UI for setting the title attribute, but it seems to have been removed in #19735 for accessibility reasons.

However, the title attribute itself remains internally for backward compatibility. Therefore, I think that developers who want to provide a UI for the title attribute can do so by hooking the Edit component.

@sahiladit
Copy link

sahiladit commented Mar 19, 2024

So should i edit it?

@yglik
Copy link
Author

yglik commented Mar 19, 2024

Previously, the button block had a UI for setting the title attribute, but it seems to have been removed in #19735 for accessibility reasons.

What a mind blowing reading that was.
thank you @t-hamano for that really important information.

Now instead of spending time building this feature into a plugin I’m going to spend time removing all my title attributes and replacing them in something more accessible.
just need to figure out what that is 😅

I think this issue can be closed

@yglik yglik closed this as completed Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Buttons Affects the Buttons Block Needs Accessibility Feedback Need input from accessibility [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

4 participants