Skip to content

Conversation

@jplOnGit
Copy link
Contributor

Adds a new property in DayPickerSingleDateController which allows users to unselect a previously selected date by clicking on it.
This PR fixes #2061.

I'm tentatively increasing the minor version given that this PR effectively adds new functionality in a backward compatible way. I'm happy to simply increase the patch version as well, even though this is not necessarily a bug fix.

Alternative considered in the implementation:
I've also considered making this functionality enabled by default, however there would be the risk that it would break users who would not handle undefined (or eventually null) in the onDateChange callback.

…allows controlling whether unselecting selected days is possible
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo comment

@ljharb ljharb force-pushed the feature/unselect-date branch from 0f3ccea to 6c2cb61 Compare February 24, 2021 03:45
@ljharb ljharb added the semver-minor: new stuff Any feature or API addition. label Feb 24, 2021
@ljharb ljharb changed the title Adds option to allow unselecting dates in DayPickerSingleDateController. [New] DayPickerSingleDateController: add allowUnselect prop option to allow unselecting dates Feb 24, 2021
@ljharb ljharb merged commit 6c2cb61 into react-dates:master Feb 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-minor: new stuff Any feature or API addition.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Support unselecting a selected date by clicking on it

2 participants