-
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
Toolbars and inserters are displaced by editor chrome #65188
Comments
Hey 👋, I believe the reason toolbar is becoming detacthed is that the update function for it's position is dependent on the reference of the underlying block and that doesn't get updated when we toggle the inserter. Here are the auto update options for the useFloating hook that is used by the toolbar. Also, along with the zoom out toolbar, the add pattern button is also getting detached. One solution to fix both the elements getting detached is to add Should we go with this approach? |
@AhmarZaidi Thank you. Yes it would be great to have you contribute to this effort. Please feel free to raise a PR with your proposed solution 👍 |
Despite improving anchoring #65627 does not fix this issue. |
#65654 is a similar issue. I'll close it in favor of this one. |
While taking a look at #65981, I noticed these styles being applied to the iframe container. I noticed that the container is much wider than the available space, and
This is the scrollbar glitch mentioned above: Kapture.2024-10-09.at.22.49.13.mp4And this the bug described in this PR being fixed by disabling those Kapture.2024-10-09.at.22.47.51.mp4 |
@ciampo yes but disabling the margin and the width breaks the UI in the sense that opening more chrome results in the canvas shrinking more and more. |
I understand — what I'm suggesting is that maybe this bug could be fixed by tweaking the "resizing styles", in particular by making the iframe container as wide as the available width in the viewport (currently it's larger) |
I agree with @ciampo that a more proper fix might be fixing the iframe's |
@ciampo How confident are you to try out a PR with the above change in #65188 (comment)? Should we punt this to 6.8 or maybe 6.7.1 if that needs more work? |
We should fix this for 6.7 IMO. Will help with any PR @ciampo gets going and I am also ;ooking at whether fixing the issue with width/margin values (I think we need to keep them to preserve the UX) solves the problem in the issue here. Otherwise my PR adding an observer may be a good patch for a while. I'd hate to have UI displacement just ship in 6.7. For the record just removing the styles reults in this reflow-no-margin-width.mp4This causes that reflow which we're working hard to tweak into non existence as we speak. |
This was reported in #65595. |
The width of the container of the iframe is so big because it is preserving the size of the viewport as it was before zoom out. This enables the iframe to extend into it to 100% and this in turn makes the browser keep the same media queries active. Attempting the same effect by applying margin and width to the iframe instead of the container does not fix the problem with UI displacement. Resizing the iframe fixes the problem with UI displacement, but breaks the feature. Scaling the iframe instead of the html keeps the iframe as wide as the workbench (gray area) which triggers media querries in zoom out when opening chrome. Tested the refactor in #63390 and the UI displacement is still there. |
I'm going to timebox an effort, hopefully today or at the latest tomorrow |
I think we need to meet this bar for quality for 6.7 👍 It's highly likely folks will encounter this UI glitch as they open/close the Patterns inserter. Thanks to everyone for digging into this in such detail. |
In Firefox the Zoom Out mode toolbar can become detacthed from the sections when you activate the
Blocks
tab of the inserter.displaced.toolbars.mp4
## Reproduction steps
The text was updated successfully, but these errors were encountered: