Skip to content
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

[Block] Table - Border width 0 does not remove cell borders in Gutenberg 15.4 #49594

Closed
cuemarie opened this issue Apr 4, 2023 · 2 comments · Fixed by #49603
Closed

[Block] Table - Border width 0 does not remove cell borders in Gutenberg 15.4 #49594

cuemarie opened this issue Apr 4, 2023 · 2 comments · Fixed by #49603
Assignees
Labels
[Block] Table Affects the Table Block [Type] Regression Related to a regression in the latest release

Comments

@cuemarie
Copy link

cuemarie commented Apr 4, 2023

Description

The border of the table block keeps showing even when the border settings is set to 0 PX.

Step-by-step reproduction instructions

  1. Insert a Table block in a post
  2. Set the border value to zero PX under the Block Settings
  3. Preview/view the post

Screenshots, screen recording, code snippet

Setup

Markup on 2023-04-04 at 15:35:02

Results

Markup on 2023-04-04 at 15:33:51


By comparison, if I deactivate Gutenberg 15.4, the borders are hidden when set to 0px:
Markup on 2023-04-04 at 15:48:51

Markup on 2023-04-04 at 15:49:17

Environment info

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@t-hamano t-hamano added Needs Testing Needs further testing to be confirmed. [Block] Table Affects the Table Block labels Apr 5, 2023
@talldan talldan added [Type] Regression Related to a regression in the latest release and removed Needs Testing Needs further testing to be confirmed. labels Apr 5, 2023
@talldan
Copy link
Contributor

talldan commented Apr 5, 2023

I can reproduce the issue.

The root cause seems to be that border is now serializing on all blocks in this format (when sides are linked):

"border":{"top":{"style":"solid","width":"44px"},"right":{"style":"solid","width":"44px"},"bottom":{"style":"solid","width":"44px"},"left":{"style":"solid","width":"44px"}}

Usually it would be in this simpler format:

"border":{"style":"solid","width":"44px"}

The first format causes the table block to apply the has-individual-borders classname, which makes only the <table> element show the applied border.

It usually does this to support the mode where you can apply different borders sizes to different sides (you'll also notice you can't remove border in this mode, with or without the Gutenberg plugin active):
Screen Shot 2023-04-05 at 1 20 58 pm

But now it does it all the time.

@aaronrobertshaw
Copy link
Contributor

#49603 addresses being able to remove borders using a simple zero-width border. There are some other trickier edge cases to deal with when it comes to separate borders per side. I'm currently working through those in a follow-up to #49603.

@priethor priethor removed the [Status] In Progress Tracking issues with work in progress label May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Table Affects the Table Block [Type] Regression Related to a regression in the latest release
Projects
None yet
5 participants