Navigation Link: Use optional chaining for linkUIref#67718
Navigation Link: Use optional chaining for linkUIref#67718yogeshbhutkar wants to merge 1 commit into
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @darnado. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. 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. |
jeryj
left a comment
There was a problem hiding this comment.
I've confirmed there's no more Uncaught TypeError when adding a block via this method. However, there may be a deeper issue here that the link ui should not be getting mounted at all after a block is added.
|
@yogeshbhutkar, closing this in favor of #67760, which fixes the root cause of the issue. |
Fixes: #67712
What?
An optional chaining for property access was introduced to access the properties of linkUIref to prevent the error described in the issue.
Why?
The absence of this optional chaining caused Uncaught TypeError and this PR is a fix in response to it.
How?
This PR fixes the issue by implementing optional chaining to resolve the error condition.
Testing Instructions
Screencast
Before:
Screen.Recording.2024-12-09.at.9.59.09.AM.mov
After:
