-
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
Fix and simplify the Modal dialog close button label #47540
Fix and simplify the Modal dialog close button label #47540
Conversation
Size Change: -122 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
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.
This makes sense and when I test the lock modal in the block editor, the aria-label and tooltip is correct.
I also tried the template part creation modal in the site editor. I added a template part and selected "Start blank". The button has the correct aria-label (Close) but it has no tooltip.
This missing tooltip seems unrelated to this PR.
I do not know if the tooltip has been removed intentionally: Without Gutenberg active, the lock modal and template part creation modal has tooltips. But with Gutenberg 15 or trunk active, there are no tooltips.
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.
LGTM 👍
Good catch. This appears to be a regression. The tooltip is rendered but it's hidden behind the modal. Will create a new issue. |
Fixes #47491
What?
There are several occurrences of the Modal usage where the passed prop name for the close button label is, incorrectly,
closeLabel
. It should becloseButtonLabel
. All the strings passed via closeLabel don't have any effect and the default string Close dialog is actually rendered.Why?
The Close button should have a meaningful, simple, label.
How?
Instead of fixing the prop name, I'd like to propose to just remove the passed props and simplify the default from 'Close dialog' to 'Close':
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast