-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Open
Labels
[Package] Components/packages/components/packages/components[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Description
Description
The editor padding controls (BoxControl?) rounds fractional pixels - enter 14.8 and it'll change it to 15 on blur. However if you first change the units and then set them back again to pixels it will allow the fractional pixels to remain.
tl;dr:
- The rounding behaviour is only applied on blur
- The validation message is subtle and hardly likely to be seen
Step-by-step reproduction instructions
- In the site editor select a block that supports dimensions / padding
- Under Dimensions → Padding in the block sidebar, press the button to allow manual value entry
- Enter a value in fractional pixels e.g
3.14 - Tab out - note the value is reset to
3 - Click
pxand change the units toem - Enter 3.14 again
- Change the units back to px, note it says
3.14 - Hover over the input and it will tell you 3.14 is an invalid value.
- Hit save and reload, note the
3.14pxis preserved - Click inside the input and click out again, note the
3.14is rounded to3
Screenshots, screen recording, code snippet
Screen.Recording.2025-11-07.at.12.38.50.mov
Environment info
Tested on GB trunk (5db7f24) with Firefox 144.0.2. It's also visible in the BoxControl storybook.
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
Please confirm which theme type you used for testing.
- Block
- Classic
- Hybrid (e.g. classic with theme.json)
- Not sure
Metadata
Metadata
Assignees
Labels
[Package] Components/packages/components/packages/components[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended