-
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
Avoid duplicate labels for "Save Draft" and "Save as pending" buttons #38776
Conversation
@@ -154,7 +154,7 @@ export default function PostSavedState( { | |||
shortcut={ displayShortcut.primary( 's' ) } | |||
variant={ isLargeViewport ? 'tertiary' : undefined } | |||
icon={ isLargeViewport ? undefined : cloudUpload } | |||
label={ label } | |||
label={ showIconLabels ? undefined : label } |
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.
I'm not 100% sure that we need a label here. The button text should be enough from a11y perspective; this only serves as a visual enhancement for the tooltip.
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.
I think the aria-label was there because that button used to be just an icon on all breakpoints. As long as there's text in the button, the aria-label isn't needed.
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.
Do you recommend removing label
or reverting changes from #38790?
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.
No, I think it's fine as it is; we still need to render the label when showing the icon button on mobile.
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.
Size Change: +3 B (0%) Total Size: 1.15 MB
ℹ️ View Unchanged
|
I think that is still the case. Screen readers will read hidden labels + text. Should we remove the label prop? |
My take was that this would only output a single piece of text (label was perhaps imprecise). If @tellthemachines has any insights to add, I'd call her the authority on this. |
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.
Thanks for fixing this @Mamaduka !
@@ -154,7 +154,7 @@ export default function PostSavedState( { | |||
shortcut={ displayShortcut.primary( 's' ) } | |||
variant={ isLargeViewport ? 'tertiary' : undefined } | |||
icon={ isLargeViewport ? undefined : cloudUpload } | |||
label={ label } | |||
label={ showIconLabels ? undefined : label } |
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.
I think the aria-label was there because that button used to be just an icon on all breakpoints. As long as there's text in the button, the aria-label isn't needed.
Description
PR fixes the issue when duplicated labels are displayed for the
PostSavedState
button.Resolves #38773.
Testing Instructions
Screenshots
Types of changes
Bugfix
Checklist:
*.native.js
files for terms that need renaming or removal).