forked from WordPress/gutenberg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not focus new navigation block menu until loading is finished (Wor…
…dPress#59801) * Do not focus navigation block until loading is finished When a new navigation is created, we place focus on the navigation block. If we place focus while loading is still happening, focus will be lost when focus the loading is finished and the block gets replaced with the new content. * Nest loading state inside of navigation ref Instead of replacing the navigation block after loading, only replace the inside part of it so that focus is not lost * Add coverage for focus loss on menu creation * select the navigatiom after import in an effect similar to the method used when creating a menu, this way the select block call is later and the focus is maintained * remove extraneous dependency causing err on delete newly created menus * Update test to not determine link control behavior * No need to return await inside an async function as it will always return a Promise Co-authored-by: Dave Smith <getdavemail@gmail.com> --------- Co-authored-by: Andrei Draganescu <andrei.draganescu@automattic.com> Co-authored-by: Dave Smith <getdavemail@gmail.com>
- Loading branch information
1 parent
adba8d5
commit 86df3db
Showing
2 changed files
with
90 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters