Value not displaying
I have an issue where the datepicker itself seems to be working fine, it is displaying the calendar dropdown, etc. But never a selected value, not does it seem to be setting the value
Not even when I try this
return (
<Datepicker
inputName="my-field
value={{
startDate:'2023-01-01',
endDate: null
}}
useRange={false}
asSingle
onChange={handleChange}
/>
)
or
return (
<Datepicker
inputName="my-field
value={{
startDate: new Date('2023-01-01'),
endDate: null
}}
useRange={false}
asSingle
onChange={handleChange}
/>
)
I'm using a monorepo with remix. This component is a separate ui package. I started wondering if this could be some kind of context related issue
The reason for my confusions is that if endDate is null, a value I considered irrelevant in an asSingle scenario, there is no inputValue change. What I would suggest is add a warning here, bc it's a little counter intuitive behaviour.
I just figured out the same. The startDate value was not shown unless there was also an endDate (with the same value).