-
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
Grid Visualizer: Fix grid item resizing in site editor #61641
Conversation
…pecicificty of a site editor selector
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +2 B (0%) Total Size: 1.74 MB
ℹ️ View Unchanged
|
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.
This appears to fix one of the issues, so this particular change LGTM. In the site editor (and in the post editor when iframed), I'm still encountering the following issues:
- The width of the box is incorrect when dragging vertically
2024-05-14.15.59.48.mp4
- When dragging right on the first child of the Grid, the bounds of the box don't extend to the edge of the Grid container
2024-05-14.16.00.15.mp4
Both of those issues are separate from the styling conflict that's resolved in this PR, so this one LGTM! 👍
Hmmm might there be anything particular in your local env that is triggering this @andrewserong ? I'm no longer able to reproduce it (and have only previously been able to on and off, usually when adding a new Grid to a template, not on existing ones after page reload) |
Thanks @andrewserong, will look into those. First one looks like a conflicting style with the separator block. edit: actually looks like both issues might be to do with this. |
That's sounding promising, thanks for digging in.
It's happening quite reliably for me, not sure if there's anything else going on with my env, but I've tested with both TT3 and TT4, and can reproduce in the iframed post editor, by adding a Grid, then adding two Paragraph child blocks, and going to expand the first block right — the resizer then gets stuck. If I then add a third paragraph block and go to drag it up, its width is not the full width of the column. |
Flaky tests detected in 0fb0e12. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9074450669
|
Do you have list view open? I have just managed to repro, but only when list view is open |
Oh, I do! I use the editor with the list view set to always be open. With the list view closed, I see it's working fine in TT3 and TT4. Great catch! |
Ah yep, nothing to do with separator. I can reliability reproduce when list view is open but not when it's closed. |
Fix for the List View issue: #61643 |
What?
Fixes bug documented in #61633.
Using the resize handles to make a grid item in the site editor smaller made both the left and right sides of the resizable box shrink towards the middle. Only the side you're dragging should move.
How?
A
margin: 0 auto
rule that's used by the site editor to keep the resizable canvas centred was conflicting withGridItemResizer
. The fix is to make that rule more specific.Testing Instructions
Screenshots or screencast
Before:
Kapture.2024-05-14.at.15.53.36.mp4
After:
Kapture.2024-05-14.at.15.48.08.mp4