gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Editing rem border-radius values triggers unintended px conversion, preventing 0.5rem input

Open hiroshisatoy opened this issue 1 year ago • 1 comments

Description

I initially discovered this issue in WordPress Playground.
After further testing, I confirmed that the same problem also occurs in a beta WordPress environment installed on my own server.

The issue was first noticed when I attempted a very common operation:
changing a border radius value from 1rem to 0.5rem.
During this process, the bug became immediately apparent because the editor does not allow the value to be changed smoothly.

Since border radius is an attribute that can be applied to many different blocks,
I believe this behavior can affect a wide range of users and may cause significant frustration during design work.

I found a bug related to editing the border-radius value in Group and Paragraph blocks.
This issue occurs in both Safari (macOS) and Chromium-based browsers (Brave).

Step-by-step reproduction instructions

  1. Open WordPress.
  2. Create a new post.
  3. Insert a Group block or Paragraph block.
  4. Set a border radius value such as 1rem.
  5. Try to change the value to 0.5rem by deleting the “1” with Backspace.

Screenshots, screen recording, code snippet

  • As soon as the first digit is deleted, the unit automatically changes from rem to px.
  • The intermediate value becomes 0.5px, which is not a valid CSS value.
  • WordPress then automatically corrects it to 1px.
  • If you manually switch the unit back to rem and try again, the same behavior happens repeatedly.
  • As a result, you cannot enter 0.5rem at all.

https://github.com/user-attachments/assets/94b0957c-25a6-4dbb-a85a-3fbb3d548d54

Environment info

OS

  • macOS

Browser

  • Safari
  • Brave (Chromium base)

WordPress

  • WordPress 6.9 RC1 (No Plugin)
  • Language: English or Japanese
  • Theme: Twenty Twenty-Five 1.3

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

hiroshisatoy avatar Nov 14 '25 12:11 hiroshisatoy

Reproduction Report

Description

✅ This report validates that the issue can be reproduced.

Environment

  • WordPress: 6.8.3
  • PHP: 8.3.27-dev
  • Server: PHP.wasm
  • Database: WP_SQLite_Driver (Server: 8.0.38 / Client: 3.40.1)
  • Browser: Chrome 142.0.0.0
  • OS: Windows 10/11
  • Theme: Twenty Twenty-Five 1.3
  • MU Plugins: None activated
  • Plugins:
    • Gutenberg 22.1.0-rc.1
    • Test Reports 1.2.1

Testing Instructions

  • The ones provided by OP

Actual Results

  1. ✅ Error condition occurs (reproduced).

Additional Notes

Nothing to add; the issue is there. I will take a look into it.

SirLouen avatar Nov 15 '25 13:11 SirLouen