Open timvandam opened 3 months ago
@shopify/retail-ui-extensions-react@1.6.0
Empty date fields display today's date rather than being empty. That's not nice for optional date fields
If you omit the value prop, set it to undefined or provide an invalid date it will default to today's date
value
undefined
<DateField label="asd" />
<DateField label="asd" value={undefined} />
<DateField label="asd" value={'some invalid value'} />
It should be empty
Correction: it defaults to the previously shown date, not to today
Please list the package(s) involved in the issue, and include the version you are using
@shopify/retail-ui-extensions-react@1.6.0
Describe the bug
Empty date fields display today's date rather than being empty. That's not nice for optional date fields
If you omit the
value
prop, set it toundefined
or provide an invalid date it will default to today's dateSteps to reproduce the behavior:
<DateField label="asd" />
<DateField label="asd" value={undefined} />
<DateField label="asd" value={'some invalid value'} />
Expected behavior
It should be empty
Screenshots
Additional context