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

Avoid duplicate labels for "Save Draft" and "Save as pending" buttons #38776

Merged
merged 1 commit into from
Feb 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/editor/src/components/post-saved-state/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Member Author

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?

Copy link
Contributor

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.

aria-disabled={ isDisabled }
>
{ isSavedState && <Icon icon={ isSaved ? check : cloud } /> }
Expand Down