Post Template Panel: Preserve parent modal when closing template creation dialog#69724
Merged
Mamaduka merged 1 commit intoMar 27, 2025
Merged
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Member
|
Thanks, @yogeshbhutkar! Rebasing should resolve failing e2e tests. |
48a1bfe to
980948f
Compare
Mamaduka
approved these changes
Mar 27, 2025
Contributor
Author
|
Thanks for the review, @Mamaduka! |
Contributor
|
@yogeshbhutkar Thanks for the fix! |
chriszarate
pushed a commit
to chriszarate/gutenberg
that referenced
this pull request
Jul 1, 2025
…tion dialog (WordPress#69724) Co-authored-by: yogeshbhutkar <yogeshbhutkar@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Closes #69722
This PR fixes a focus loss issue when the template creation dialog is closed via the Escape key or the Cancel button.
Why?
The issue occurs because, upon closing the modal, focus should return to its trigger button. However, closing the modal also closes the parent dropdown containing the trigger, leaving no element to receive focus—causing it to be lost entirely.
How?
Similar to how the
Change Templatemodal closes without affecting the parent dropdown, this PR ensures that closing the template creation dialog only dismisses the dialog itself. This prevents the parent dropdown from closing, allowing focus to be retained properly.Testing Instructions
Templatelabel.Create new templatedialog.ESCbutton or click theCancelbutton.Testing Instructions for Keyboard
Same.
Screencast
PR.mov