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

click date input randomly triggers outside click #2237

Open
Rliulinz opened this issue Aug 8, 2023 · 0 comments
Open

click date input randomly triggers outside click #2237

Rliulinz opened this issue Aug 8, 2023 · 0 comments
Labels
bug Oh no, something's broken :-( pull request wanted This is a great way to contribute! Help us out :-D

Comments

@Rliulinz
Copy link

Rliulinz commented Aug 8, 2023

react-dates version
"@types/react-dates": "21.8.1",

Describe the bug
Click start or end date inputs in range picker, it triggers click outside firstly which calls onFocusChange with null and moves on to call onClose, then range picker gets the focus on the target input and calls the onFocusChange with new focused input. This will make the picker panel flashing and impossible to capture the right event of picker is closing.

Source code (including props configuration)
Steps to reproduce the behavior:

<DateRangePicker
                    startDate={pickerDateRange.startDate},
                    startDateId="startDate",
                    endDate={pickerDateRange.endDate},
                    endDateId="endDate",
                    onDatesChange={({ startDate, endDate }) => {
                      update start and end dates
                    }
                    focusedInput={focusedInput} ,
                    onFocusChange={(focused) => setFocusedInput(focused)} ,
                    isOutsideRange={() => false}
                    initialVisibleMonth={() => moment().subtract(1, "month")}
                    displayFormat={() => "DD/MM/YYYY"}
                    showDefaultInputIcon={true}
                    numberOfMonths={2}
                    readOnly={true}
                  />

Desktop (please complete the following information):

  • OS: WINDOWS
  • Browser [chrome]
@ljharb ljharb added bug Oh no, something's broken :-( pull request wanted This is a great way to contribute! Help us out :-D labels Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Oh no, something's broken :-( pull request wanted This is a great way to contribute! Help us out :-D
Projects
None yet
Development

No branches or pull requests

2 participants