-
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
Inserter: Fix subtle media insertion error #65057
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. |
Size Change: +224 B (+0.01%) Total Size: 1.78 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.
Nice find 🚀
Co-authored-by: Marco Ciampini <marco.ciampo@gmail.com>
This is the right change. The focus recovery is still required when inserting a block that will end up having a filtered list, like inserting a list block that rerenders the inserter and focus moves to the first item in the rerendered inserter (list item block). |
@jeryj, by "filtered list", do you mean restricted by "allowed blocks"? When inserting the List block, the focus stays and doesn't move to the first item in the rerendered inserter (List Item). ScreenshotCleanShot.2024-09-04.at.19.27.40.mp4 |
It does move for me. I'm in the site editor though with a lot of blocks, so it might be due to the slow rerender. It may also be that my cursor is within the content vs in the inserter which is having that odd issue. list.block.item.focus.mov |
I'm getting the same results in the post editor with 30+ blocks (you can use a Demo post); the cursor is within the content. So it seems we've regressions or inconsistent behavior between editors. |
What?
This PR fixes an error in the inserter when inserting an image (see screenshot below).
Why?
Just resolving an error.
Discovered while testing #65043.
How?
We're ensuring the blocks tab exists before attempting to resolve the previously lost focus.
Testing Instructions
Testing Instructions for Keyboard
Same
Screenshots or screencast