g2 icon indicating copy to clipboard operation
g2 copied to clipboard

UnitInput: Fix unit change for zero values

Open ItsJonQ opened this issue 4 years ago • 2 comments
trafficstars

It looks like UnitInput is unable to handle unit changes for values like 0px -> 0vh

ItsJonQ avatar Feb 02 '21 15:02 ItsJonQ

Why should it handle them? Changing units when the value is 0 doesn't really change anything... 0px is the same as 0% and 0em :thinking:

aristath avatar Feb 03 '21 07:02 aristath

Great question! The rendered value doesn't change (CSS wise). However, I think the UI feels broken if I (the user) manually typed a change from 0px or 0vh. Or worse... used the unit selector to change from 0px to 0vh.

Neither methods work at the moment 🙈

https://g2-components.xyz/iframe.html?id=components-unitinput--default&viewMode=story

ItsJonQ avatar Feb 09 '21 13:02 ItsJonQ