Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Change the selection state #11

Open
matepaiva opened this issue Jan 22, 2019 · 1 comment
Open

Change the selection state #11

matepaiva opened this issue Jan 22, 2019 · 1 comment

Comments

@matepaiva
Copy link

Hello, there!

First of all, thank you very much for your work. Your component is helping us a lot.

I saw that the component have a prop called initialSelections which I can pass an array of selected dates. Is there any prop that I can use to override the current state of selected dates?

I want to let the user click in a "clear" button and remove all the selected dates, but I didn't find out how to force the component to have a specified state.

Thank you!

@trotzig
Copy link
Owner

trotzig commented Jan 24, 2019

Hi @matepaiva! This is a use case that I haven't come across yet. It totally makes sense, I'd be willing to accept a PR adding support for this. Essentially, we'd have two versions of the component - one "controlled" where you are responsible for keeping state, and one "managed" where state is handled internally.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants