-
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
Columns Block: Prevent removal of locked columns from the column count change UI #49530
Conversation
Size Change: +172 B (0%) Total Size: 1.34 MB
ℹ️ View Unchanged
|
Flaky tests detected in 91921bb. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4593470947
|
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.
Nice work, thanks for following up on this detail @t-hamano and for adding the e2e coverage! This is testing well for me:
✅ Min, max, and the slider all work as-is when no locked blocks are present
✅ When a locked column block is present, its index is used to determine the minimum count, and the slider for column count works as expected 👍
LGTM! ✨
Co-authored-by: Andrew Serong <[email protected]>
Thanks for the review, @andrewserong! |
); | ||
|
||
// The min attribute should take into account locked columns | ||
await expect( columnsChangeInput ).toHaveAttribute( 'min', '3' ); |
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.
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.
@kevin940726
Thank you for noticing!
I was able to reproduce the same error locally as on GitHub Action. I fixed it in #49676 and it appears to be fixed locally. I will run the test several times on GitHub.
Follow-up based on this comment in #48691
What?
This PR prevents the
core/column
block from being removed from the sidebar of thecore/columns
block when one of thecore/column
blocks is locked(prevent removal).How?
Based on the behavior that when the number of columns is reduced from a sidebar, it is removed from the column block behind it, I have implemented the following:
minCount
)Screenshots or screencast
64986419fd5fe58b5bc29d6e43a74970.mp4
E2E test
(Speed is reduced to 1/4)
92f210af0be2da1d76ee9130829dd825__online-video-cutter_com___1__AdobeExpress.mp4