LineHeightControl: Unexpected decrements and adjustments of zero values #48768
Labels
[Feature] Design Tools
Tools that impact the appearance of blocks both to expand the number of tools and improve the experi
[Feature] UI Components
Impacts or related to the UI component system
[Type] Bug
An existing feature does not function as intended
Related:
Description
The
LineHeightControl
currently behaves in unexpected ways when adjusting via the down arrow key, dragging down, or pressing enter while the value is0
.Actual Behaviour
With a value set in the LineHeightControl, decrementing the value beyond
0
results in the value suddenly being reset to the placeholder default value of1.5
.If you click into the LineHeightControl, type
0
, then press enter, moving focus away from the control will result in it being reset to1.5
. Note: If you type0
then move focus away without pressing enter, the0
value will be retained.Expected Behaviour
Decrementing a value in the LineHeightControl to
0
and then attempting to decrement again will keep the0
value when that is the minimum value set on the field.If you type
0
into the field, and then press enter before moving focus elsewhere, the0
value should be retained.Step-by-step reproduction instructions
0
and see it get reset to the default placeholder value of1.5
0
, press enter, and then transfer focus elsewhere.0
value was lost and the placeholder is shown againScreenshots, screen recording, code snippet
Screen.Recording.2023-03-06.at.5.41.29.pm.mp4
Environment info
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
The text was updated successfully, but these errors were encountered: