Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Value not displaying #217

Open
mschipperheyn opened this issue Nov 17, 2023 · 2 comments
Open

Value not displaying #217

mschipperheyn opened this issue Nov 17, 2023 · 2 comments

Comments

@mschipperheyn
Copy link

mschipperheyn commented Nov 17, 2023

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
Copy link
Author

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.

@romdim
Copy link

romdim commented Feb 27, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants