Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

click date input randomly triggers outside click #2237

Copy link
Copy link
Open
@Rliulinz

Description

@Rliulinz
Issue body actions

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugOh no, something's broken :-(Oh no, something's broken :-(pull request wantedThis is a great way to contribute! Help us out :-DThis is a great way to contribute! Help us out :-D

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.