-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Nav offcanvas - creating a menu from the block list view transfers focus back to canvas #47018
Comments
It's weird because the gutenberg/packages/block-editor/src/components/off-canvas-editor/appender.js Lines 36 to 45 in a4879a6
I guess that prop doesn't work. Edit: I think the issue in the video is that a menu was created, and I think it's that causing the focus loss. In general usage I don't see any issues with focus being transferred. |
I have a sneaking suspicion that "focus" and "selected" are different things. I could be wrong... |
I figured this out. It's as @talldan suspected. If you have no menus then inserting a Navigation block will create an "auto menu" which is basically a Page List block. If you then use the Nav list view to insert a new block into this menu then a new Navigation menu ( Note how in the video below the focus gets transferred to the iframe when the menu is created. Note also that once the menu is created and I add a item to the menu, focus is handled correctly. Screen.Capture.on.2023-01-11.at.10-05-06.mp4When a menu is created the focus should remain in the Nav list view. |
I tested this some more and I found that the selected block in the editor state is the Navigation block. But the focus is not on that block - somehow it ends up on an iframe. I suspect this may be a wider bug... |
CC: @ellatrix per the iframe. |
As reported in #46939 (comment), when inserting blocks focus (note this is different to block selection) may be transferred to the canvas.
Instead focus should remain within/return to the context of the offcanvas from which you added the block.
The text was updated successfully, but these errors were encountered: