Font size picker: custom font size step value for em
and rem
units is only 0.01
#69012
Open
2 of 6 tasks
Labels
[Package] Components
/packages/components
[Type] Bug
An existing feature does not function as intended
Description
The font size picker has some simple logic in place that is used to determine when a custom font size unit is 'relative' as in: 'em', 'rem', 'vw', or 'vh'.
When it's a relative unit, the value of the
step
prop changes but only for the slider. It doesn't for the input. As such, when changing units toem
orrem
, the steps of the input and of the range slider aren't aligned.When using a the up and down arrow keys to change the
em
orrem
values of a custom font size, the value chantes by only0.01
at each key press. Which makes this control redious to use as it requires dozens of key presses or holding the key for a long time to eb able to amke a substantial change for the value.Animat4ed GIF to illustrate:
Turns out, the font size picker
RangeControl
does pass an explicit step prop.The
UnitConrol
doesn't.When the unit is
em
orrem
, the input field step value is0.01
. Instead, the range one is0.1
.This could be quickly fixed by simply passing an explicit
step
prop to theUnitControl
similarly to theRangeControl
.However, I wonder why in the
UnitControl
logic that tries to determine the fallbackstep
values from the selected units, theem
andrem
default step value is 0.01 which seems to me too low in the first place.Step-by-step reproduction instructions
px
.step
attribute for both the input field and the ragne input is1
.vw
orvh
units.step
attribute for both the input field and the ragne input is0.1
.em
orrem
units.step
attribute is0.01
for the input and0.1
for the range slider.0.1
for both.Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
The text was updated successfully, but these errors were encountered: