Skip to content

Prevent to hide datepicker when clicking anywhere, but close it when clicking close button #154

@DanielBSeeTrue

Description

@DanielBSeeTrue

I want to be able to close when clicking the X close button
but not to close when clicking anywhere
I tried implementing that if onFocusChange , focusinput is null, I will keep it open by focusing on start date
but the button close also produced null

my code:

<DateRangeInput
        onDatesChange={(data) => {
          setState(data);
        }}
        onFocusChange={(focusedInput) => {
          console.log(focusedInput); 
          if (focusedInput === null) {
            setState((prev) => ({ ...prev, focusedInput: START_DATE }));
          } else {
            setState((prev) => ({ ...prev, focusedInput }))
          }
        }
        }
        startDate={props.startDate}
        endDate={props.endDate}
        focusedInput={state.focusedInput}
        displayFormat="dd/MM/yyyy"
      />

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions