-
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
Block Library: Button: Remove title attribute handling #19735
Conversation
I'm all for this and the follow-ups. The less title attributes, the better for keyboard, touch, and screen readers. Out of curiosity: I saw that you remove a title attribute on a div element here. Did that actually ever do anything useful even for sighted people? :-) |
Practically speaking, it was applying the |
The UX for an absent link title has been improved in #19739, so I'll remove the "[Status] Blocked" label. Thanks @MarcoZehe for your comments at #19735 (comment) . I'll remove "Needs Accessibility Feedback" label accordingly. I might like to invite some feedback from one or more of @mtias @getdave or @jorgefilipecosta in case there might be some justification to consider that we've missed for keeping these attributes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Provided that we are ok with removing title attribute from links on the "a" element on the frontend it looks good to me 👍
I think it may make sense to add a comment in save.js above the title attribute saying that right now the attribute is never set?
That's a good thought. I added a comment in d32c29d. |
d32c29d
to
e4b8957
Compare
e4b8957
to
670ed98
Compare
As a follow-up to this, I created #19990 to remove the |
See related: #20198 |
Previously: #17352, #19462 (comment), #19490 (comment), #616
This pull request seeks to remove UI controls which assign a
title
attribute for a block.This is based on advisory resources and related core efforts which recommend that
title
attributes be avoided for links:The proposed changes do not currently remove the attribute from the block definition, nor do they prevent the attribute from being applied when rendering the generating the block's saved markup. This is to avoid invalidations of existing blocks. We could potentially choose to implement a deprecation to remove the attribute altogether, but the implementation as proposed seemed simplest in that it merely prevents the addition of new titles.
Current Status: I'm considering this as blocked by the issue described in #19651 (comment), where an empty title would introduce a confusing user experience for editing links.
Testing Instructions:
Verify that when selecting a link for a Button block, the resulting post markup does not contain a
title
attribute:title
attributeFollow-up Tasks: If these changes are considered acceptable, a similar effort should be undertaken to remove the assignment of
title
attribute for the navigation link block:gutenberg/packages/block-library/src/navigation/index.php
Lines 187 to 189 in c8a1eef
The "Image" block also includes
title
assignment, but my understanding is that it is not quite as problematic for use in images (see also #11054).