Commit 08f14e9
Do not focus new navigation block menu until loading is finished (WordPress#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 <[email protected]>
---------
Co-authored-by: Andrei Draganescu <[email protected]>
Co-authored-by: Dave Smith <[email protected]>1 parent 87d3d4f commit 08f14e9
File tree
2 files changed
+90
-50
lines changed- test/e2e/specs/editor/blocks
2 files changed
+90
-50
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
| 345 | + | |
355 | 346 | | |
356 | 347 | | |
357 | 348 | | |
| |||
402 | 393 | | |
403 | 394 | | |
404 | 395 | | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
405 | 399 | | |
406 | 400 | | |
407 | 401 | | |
| |||
414 | 408 | | |
415 | 409 | | |
416 | 410 | | |
| 411 | + | |
| 412 | + | |
417 | 413 | | |
418 | 414 | | |
419 | 415 | | |
| |||
866 | 862 | | |
867 | 863 | | |
868 | 864 | | |
869 | | - | |
870 | | - | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
871 | 874 | | |
872 | 875 | | |
873 | 876 | | |
874 | | - | |
875 | | - | |
| 877 | + | |
876 | 878 | | |
877 | | - | |
878 | | - | |
879 | | - | |
880 | | - | |
881 | | - | |
882 | | - | |
883 | | - | |
884 | | - | |
885 | | - | |
886 | | - | |
887 | | - | |
888 | | - | |
889 | | - | |
890 | | - | |
891 | | - | |
892 | | - | |
893 | | - | |
894 | | - | |
895 | | - | |
896 | | - | |
897 | | - | |
898 | | - | |
899 | | - | |
900 | | - | |
901 | | - | |
902 | | - | |
903 | | - | |
904 | | - | |
905 | | - | |
906 | | - | |
907 | | - | |
908 | | - | |
909 | | - | |
910 | | - | |
911 | | - | |
912 | | - | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
913 | 911 | | |
914 | 912 | | |
915 | 913 | | |
| |||
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
543 | 543 | | |
544 | 544 | | |
545 | 545 | | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
546 | 588 | | |
547 | 589 | | |
548 | 590 | | |
| |||
0 commit comments