tailwind-datepicker-react icon indicating copy to clipboard operation
tailwind-datepicker-react copied to clipboard

handleClickOutside doesn't work when providing own `input` element

Open carstenblt opened this issue 2 years ago • 3 comments

handleClickOutside relies on refs to the input element and the picker modal, which are not available when using an individual input element.

carstenblt avatar Sep 04 '23 21:09 carstenblt

You could add a blur listener to set the "show" state to false as a workaround here, I guess. Hope this helps :)

GinaBiondo-aperto avatar Dec 29 '23 21:12 GinaBiondo-aperto

@carstenblt I've created a PR to pass inputRef with options: https://github.com/OMikkel/tailwind-datepicker-react/pull/53

szpada87 avatar Feb 06 '24 09:02 szpada87

You could add a blur listener to set the "show" state to false as a workaround

I tried this but that made the picker disappear before a value is chosen

tgnhrkn avatar Mar 13 '24 06:03 tgnhrkn