-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Social links: Prevent empty links and improve UI description #60044
Comments
I also noticed that the frontend will still render This PR is a quick win to use the fall back value in these cases so there's at least some text there. |
After some debugging, the tooltip doesn't work because the gutenberg/packages/block-library/src/social-link/edit.js Lines 160 to 182 in f940341
So that after #57202 the tooltip will not show. Cc @ciampo while I think this instance can be easily fixed, looks like #57202 may introduce other regressions still undiscovered. How we can catch and prevent these cases? Thanks. |
Description
After users edit and empty a social link 'label', the link on the front end is empty. No text, no aria-label. Just an empty link.
WordPress should always output semantic, SEO friendly, and accessible HTML. No empty links should ever be allowed.
The resulting HTML output may end up being, for example:
Rendering empty links on the front end doesn't help produce high quality, SEO friendly and accessible content. This must be avoided.
Users already have the option to visually hide the social link text and only show the icon. As such, there is no reason to make this link text empty. It must always be populated with some meaningful text.
This issue is even worse when 'Show labels' in the block setttings panel is disabled as the fact the link is empty is not visible to editors. There's no feedback at all the link is empty.
Technically, this:
gutenberg/packages/block-library/src/social-link/edit.js
Line 116 in c434659
doesn't work very well after users edit the link text.
label
prop is initially undefined, so the default link text is the social network name. So far so good.label
prop is set to empty string.Step-by-step reproduction instructions
Enter address
which is inconsistent with other terminology used across the editor.https://github.com/myusername
and save.GitHub
.Briefly describe the link to help screen reader users.
isn't appropriate when 'Show labels' is enabled. In this case, this is the visible link text. Not something only for screen readers. Also, we should rarely mention specific assistive technology. This is the actual link text and should be clarified to users.Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: