-
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 focus loss when deleting selected block in zoom out mode #65761
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: 0 B Total Size: 1.77 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.
Tested. Works as described. Nice catch.
Yet another instance that could be caught if we had some automated testing for catching focus loss.
e449719
to
bf5393d
Compare
The |
…ordPress#65761)" This reverts commit 467623a.
It's not about block selection, but where focus goes after the deletion, especially after deleting a section with a main query loop: Before - Main section deletion before.-.focus.loss.when.deleting.main.section.movBefore - General section deletion before.-.focus.returns.to.delete.button.after.delete.but.on.new.block.movAfter - Main section deletion Focus returns to canvas. after.-.deleting.main.focus.returns.to.canvas.movAfter - General section deletion Focus returns to canvas. after.-.deleting.normal.section.block.mov |
I just cherry-picked this PR to the wp/6.7 branch to get it included in the next release: 7ace071 |
Fixes #65762
What?
Moves focus to the block canvas when deleting a block via the zoom out toolbar
Why?
Focus loss is bad.
How?
__unstableContentRef.current?.focus();
when deleting the block.Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast