Avoid duplicate labels for "Save Draft" and "Save as pending" buttons#38776
Conversation
| variant={ isLargeViewport ? 'tertiary' : undefined } | ||
| icon={ isLargeViewport ? undefined : cloudUpload } | ||
| label={ label } | ||
| label={ showIconLabels ? undefined : label } |
There was a problem hiding this comment.
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.
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.
Do you recommend removing label or reverting changes from #38790?
There was a problem hiding this comment.
No, I think it's fine as it is; we still need to render the label when showing the icon button on mobile.
|
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. |
tellthemachines
left a comment
There was a problem hiding this comment.
Thanks for fixing this @Mamaduka !
| variant={ isLargeViewport ? 'tertiary' : undefined } | ||
| icon={ isLargeViewport ? undefined : cloudUpload } | ||
| label={ label } | ||
| label={ showIconLabels ? undefined : label } |
There was a problem hiding this comment.
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
PostSavedStatebutton.Resolves #38773.
Testing Instructions
Screenshots
Types of changes
Bugfix
Checklist:
*.native.jsfiles for terms that need renaming or removal).