-
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
Uncaught TypeError when adding new blocks to the Navigation Core Block in Wordpress #67712
Comments
I can confirm the error on the Gutenberg trunk. The code in question was introduced in #61975. gutenberg/packages/block-library/src/navigation-link/edit.js Lines 575 to 584 in 7cf1ced
cc @jeryj |
I think there may be a deeper bug here. I don't think this code should not be reached when adding a block from the sidebar. When I test locally, the Link UI isn't closing after I click "Browse all." It stays open and doesn't transfer focus to the sidebar. |
It looks like the root issue is the Inserter is no longer auto-transferring focus to the aria-selected tab when it mounts. |
That was my guess as well. As usual, it would be better to fix the actual bug instead of its symptom (#67718). cc @yogeshbhutkar |
I have to write the PR description and issue, but here's a fix for the inserter focus issue: #67754 |
Oddly enough, even though the link ui popover is closed from focus being transferred to the inserter in #67754, the type error is still happening. The link ui popover shouldn't be mounted at all, so I don't know why the onClose is being called... |
It might be because the focus moves to another element. I think this is what is happening:
|
Been debugging this more. I think the popover onClose is working right. My best lead so far is this line that calls the |
I'm not sure if it causes a new bug or misses covering a necessary scenario, but #67760 is fixing this issue at least 😅 |
Description
An "Uncaught TypeError" appears in the console when adding a block to the Navigation Core Block via the sidebar. Despite the error, the block is successfully added.
Expected Result:
Actual Result:
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Environment info
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
The text was updated successfully, but these errors were encountered: