WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
9.99k stars 4.01k forks source link

Box Control range slider doesn't set a unit initially #61410

Open albanyacademy opened 1 month ago

albanyacademy commented 1 month ago

Description

When using the __experimentalBoxControl with all values as null, the unit for each side is only set when the UnitControl itself is changed. When one uses the RangeControl first and drags to a number, the value received is just the number itself without a unit attached.

Step-by-step reproduction instructions

  1. Use a box control with a default value empty/null;
  2. set the onChange to console log the value;
  3. observe that when only dragging the range slider the value returned is only a number
  4. observe that unit only gets added when unitcontrol is used

Screenshots, screen recording, code snippet

https://www.screencast.com/t/I3RDlCL9ht2

Environment info

wp 6.5.2

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 commented 1 month ago

Thanks for the report. I don't know if this specification was intended or a bug, but I was able to reproduce the problem on Storybook.

https://github.com/WordPress/gutenberg/assets/54422211/77943da7-d413-4adb-b7e6-b78343056060

mirka commented 1 month ago

Interesting. It might be debatable, but I think we can say this is a bug.