Closed ItsJonQ closed 3 years ago
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/itsjonq/g2/o7lv4525j
✅ Preview: https://g2-git-fix-unit-input-initial-auto.itsjonq.vercel.app
This update fixes the handling of values like
auto
forUnitInput
. Previously,auto
may be assigned as aunit
value.This is because of the unit parsing function as it attempts to split
${number}${unit}
into[value,unit]
. Sinceauto
doesn't start with a number, the unit parser thinks thatauto
is the unit.The solution was to add some validation for the initial store state, taking into consideration the
cssProp
, if provided.