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

Changing range value in input does not update value in the calendar #3596

Open
serhiiminin opened this issue May 16, 2022 · 5 comments
Open
Labels

Comments

@serhiiminin
Copy link

Describe the bug
When changing the input value in range mode it does not trigger the change in the calendar.

() => {
  const [range, setRange] = useState([new Date("2014/02/08"), new Date("2014/02/10")]);
  const [startDate, endDate] = range;
  return (
    <>
      <DatePicker
        onChange={(date) => setRange(date)}
        selectsRange={true}
        startDate={startDate}
        endDate={endDate}
      />
    </>
  );
};

To Reproduce
Steps to reproduce the behavior:

  1. Use my setup
  2. Click on input to open the popup with the calendar
  3. Try to change the input value
  4. Observe that the calendar value is not changed

Expected behavior
If the value in input is a valid date then the value in the calendar is changed (similar to the single select behavior)

Screenshots
image

Desktop (please complete the following information):

  • OS: iOS
  • Browser chrome

Additional context
I looked into the code and it seems the issue is with parsing. The parsing function can't handle ranges.
https://github.com/Hacker0x01/react-datepicker/blob/master/src/index.jsx#L486

@dvelichuk
Copy link

Same issue for all browsers. Mac osx

@eliranhasin1121
Copy link

Hi, do you have any updates about this issue?

@jphawk
Copy link

jphawk commented Sep 23, 2022

Same issue here. It would be great to have a fix for this

Copy link

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the Stale label Jun 16, 2024
@laug
Copy link
Contributor

laug commented Aug 15, 2024

See also #3906 and #4002 which report the same issue.

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

No branches or pull requests

5 participants