-
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
Navigation Overlay: Improve handling of open overlay. #32886
Conversation
Size Change: +557 B (0%) Total Size: 1.05 MB
ℹ️ View Unchanged
|
9adf49a
to
f34022a
Compare
Thank you for testing. That's curious, I can't directly reproduce. Here's trunk: Here's this branch: Clearly there's still some work to be done (though arguably an entirely missing block toolbar might be better than an arbitrarily floating one?). Oh, it just hits me you're using the site editor, where the block toolbar is outside the iframe and therefore in a different stacking order where it can overlay. Alright, so what it seems like is that the block toolbar is actually attached to the parent menu item, the one outside of the overlay menu. The menu you see inside the overlay is actually a duplicate. It seems like we might need to address this separately, CC: @vcanales. Based on the headaches we've encountered with this PR, the question is whether overlay menu editing needs to happen in its own instance entirely. See #29148 for a conversation on isolated editing. In the mean time, since the situation in trunk is not ideal, I wonder if we should land this one as an interim bandaid? |
f34022a
to
31fd743
Compare
I pushed a fix for the iframe, and can see the block toolbar there. I also figured out that unlike what I said before, the contents of the overlay is actually the navigation block, but the positioning is okay for me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
The navigation overlay menu, the one you get when you enable "Responsive menu" on the navigation block, can be opened inside the editor. When that happens, you see the full overlay just like you do on the frontend.
However where
position: fixed;
for the fullscreen menu is fine on the frontend because it literally needs to cover everything, when inside the editor, we still need to see the UI, like the top toolbar, the sidebar, etc. And we can't useposition: absolute;
because there are some ancestors settingposition: relative;
, breaking that.This PR adds:
is-mobile-preview
andis-tablet-preview
andis-desktop-preview
.I suspect the device preview classes are useful in other contexts, but let me know if you'd prefer me to find another way to handle this.
A silver lining is: all of this positioning stuff can be removed when this lands in an iframe, including making the preview accept the device preview sizings.
How has this been tested?
Insert a navigation menu with some menu items. Enable responsive menu. Add a background color so you can more easily see the overlay. Now scale the viewport small so the burger menu becomes visible. Then click the burger menu and resize back.
Now try combinations of device preview, top toolbar, fullscreen, and breakpoints.
Checklist:
*.native.js
files for terms that need renaming or removal).