gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Border width cleared for individual sides shows correctly in editor but renders full border on frontend

Open dpmehta opened this issue 9 months ago • 1 comments

Description

I encountered a mismatch between the editor view and the frontend output when modifying border widths for a Paragraph block.

After clearing border width values for specific sides, the editor preview reflects the change correctly, but the frontend still renders borders on all four sides.

This results in inconsistent rendering between editor and frontend.

Step-by-step reproduction instructions

  1. Add a core Paragraph block.

  2. Enter some text.

  3. Apply:

    • Background color
    • 2px solid black border on all sides.
  4. Save the post and verify on the frontend -> rendering is correct.

  5. Go back to the editor and:

    • Split border controls into individual sides.
    • Clear the width values for left, right, and bottom borders.
    • Leave only the top border width defined.
  6. Observe:

    • Editor view: shows only the top border (correct).
    • Frontend view: still displays all four borders.

Screenshots, screen recording, code snippet

https://github.com/user-attachments/assets/1fc3c9b3-31b4-4988-984a-865ee393378e

Environment info

No response

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

  • [x] Yes

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

  • [x] Yes

Please confirm which theme type you used for testing.

  • [x] Block
  • [ ] Classic
  • [ ] Hybrid (e.g. classic with theme.json)
  • [ ] Not sure

dpmehta avatar Feb 11 '26 12:02 dpmehta

A fix for this has been merged via #75546.

There is further discussion around the nuances of this issue in https://github.com/WordPress/gutenberg/pull/75431#issuecomment-3902750972

aaronrobertshaw avatar Feb 16 '26 06:02 aaronrobertshaw