It is not possible to clear the selected range, or am I missing something?
dateRangeSelected = selectedDateRange => {
this.setState({ selectedDateRange: null });
}
<Calendar
onChange={this.dateRangeSelected}
value={this.state.selectedDateRange}
selectRange={true}
/>
This doesn't clear the selection
Hi,
have you tried using React-Calendar 3.0 beta as a controlled component? It should have this issue resolved.
I have the same issue - I have the calendar with no initial selection (the 'Custom period' in the gif), but once I start interacting with it the value can never be reset to null. I'm using [email protected].
My simplified code looks similar to the above:
<FilterButton onClick={() => setDateRange(null)}>
Custom period
</FilterButton>
<Calendar
value={dateRange}
onChange={value => setDateRange(value)}
selectRange
doubleView
/>

Most helpful comment
I have the same issue - I have the calendar with no initial selection (the 'Custom period' in the gif), but once I start interacting with it the
valuecan never be reset tonull. I'm using[email protected].My simplified code looks similar to the above: