Editor: Fix drag and drop to the top of the page#71241
Editor: Fix drag and drop to the top of the page#71241talldan merged 2 commits intoWordPress:trunkfrom
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. |
talldan
left a comment
There was a problem hiding this comment.
Works great, thanks for the fix, and for finding the block with the issue.
I also tested the drag and drop changes without the block fix, and it works well, so it means drag and drop will work better if a third party block might have this kind of bug.
* Fix: Guard drag-and-drop against missing block DOM nodes * Fix: Ensure Post Comments Link always renders block wrapper ---- Co-authored-by: karthikeya-io <karthikeya01@git.wordpress.org> Co-authored-by: talldan <talldanwp@git.wordpress.org> Co-authored-by: tellthemachines <isabel_brison@git.wordpress.org>
What?
Closes #71198
Why?
useBlockPropsused incorrectly or if the block doesn't render any markup.Uncaught TypeError: Cannot read properties of null (reading 'getBoundingClientRect').How?
getElementByIdcalls and returnnullif no block element exists and add null-safe checks arounddropZoneElement.getBoundingClientRect()nulland render warning.Testing Instructions
Comments LinkblockTesting Instructions for Keyboard
Screenshots or screencast
Before and After
Screen.Recording.2025-08-19.at.1.51.27.AM.mov