react-tailwindcss-datepicker icon indicating copy to clipboard operation
react-tailwindcss-datepicker copied to clipboard

Value not displaying

Open mschipperheyn opened this issue 2 years ago • 2 comments

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

mschipperheyn avatar Nov 17 '23 21:11 mschipperheyn

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.

mschipperheyn avatar Nov 19 '23 15:11 mschipperheyn

I just figured out the same. The startDate value was not shown unless there was also an endDate (with the same value).

romdim avatar Feb 27 '24 13:02 romdim