Open InciteDemocracy opened 7 years ago
I played around with this for a bit and had to timebox it. This is a bit tricky due to the datepicker not exposing the open
state and setOpen
method. These can be reached by using the ref
attribute but I had already spent too much time on this for now.
for reference: https://github.com/Hacker0x01/react-datepicker/issues/283#issuecomment-223517743
Hmmm, startOpen
prop is exist, but isOpen
missed. I think, isOpen
should be added to prevent ref manipulation, it's so tricky doing it with ref. Especially, if you want to use functional component with more then one datapicker :)
A second click to the button that opened the popup should close it.