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

Type input not working when entering end date #2211

Open
safaasadi opened this issue Jul 14, 2022 · 0 comments
Open

Type input not working when entering end date #2211

safaasadi opened this issue Jul 14, 2022 · 0 comments

Comments

@safaasadi
Copy link

react-dates version
"version": "21.8.0"

Describe the bug
When typing in the input field for date range picker it works on the start date but when typing on the end date it erases the start date input. Thus making it impossible to put date ranges dating from years back.

 <DateRangePicker
      startDateId="start"
      endDateId="end"
      isOutsideRange={falseFunc}
      renderCalendarInfo={() => renderDatePresets(moment(dateRange.start), moment(dateRange.end))}
      startDatePlaceholderText="Start date"
      endDatePlaceholderText="End date"
      startDate={dateRange.start ? moment(dateRange.start) : null}
      endDate={dateRange.end ? moment(dateRange.end) : null}
      focusedInput={focusedInput}
      onFocusChange={(focused) => {
        setFocusedInput(focused);
      }}
      onDatesChange={({ startDate, endDate }) => {
        if (isSameDay(startDate, endDate)) {
          setDateRange({
            start: startDate ? moment(startDate) : undefined,
            end: endDate ? endDate.startOf("day").add(1, "day") : undefined,
          });
        } else {
          setDateRange({
            start: startDate ? moment(startDate) : undefined,
            end: endDate ? moment(endDate) : undefined,
          });
        }
      }}
      onClose={({ startDate, endDate }) => {
        if (startDate === null || endDate === null) {
          setDateRange({
            start: [undefined,](url)
            end: undefined,
          });
        }
      }}
      small={true}
      minimumNights={0}
      daySize={35}
      showClearDates
    />
Screen.Recording.2022-07-14.at.11.35.24.AM.mov
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

1 participant