-
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
Table Block: Don't render empty section #47753
Conversation
Size Change: -2 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
Flaky tests detected in 14e3bea. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4091004146
|
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.
LGTM, thanks for spotting and fixing this.
What?
This small PR changes the editor to not render sections without rows (
thead
/tfoot
).Why?
To match the front-end rendering results.
I also discovered that this issue affects when implementing caption toolbar buttons, as was done in #45112 and #47325. If the caption is hidden, an empty tfoot tag will cause unexpected scrolling.
ce999fbf1f211ebf91ec6d870facb14f.mp4
How?
When each section is rendered, I used a
sections
variable with empty sections removed instead of a hard-coded section array.Testing Instructions
After inserting a table with no header/footer, confirm that it only has a
tbody
element directly below thetable
tag.