react-multi-date-picker icon indicating copy to clipboard operation
react-multi-date-picker copied to clipboard

picker is not closing on modal

Open n-rezaei opened this issue 3 years ago • 10 comments

if you set a picker on modal, after focusing on input, picker shown up but clicking on outside of input like focusing on other inputs or modal itself, the picker not closed

n-rezaei avatar Jun 02 '22 06:06 n-rezaei

Did you find any solution or workaround for it?

rvenky125 avatar Jul 27 '22 05:07 rvenky125

I had same issue. I'd added label element as parent of calendar. I fixed it by removing label element.

deadfire2019 avatar Aug 01 '22 08:08 deadfire2019

Hey! I had resolved this issue with hook. Add ref to your DatePicker component and use closeCalendar() method.

Example: useOnClickOutside(datePickerRef, () => datePickerRef.current?.closeCalendar());

yahayahu avatar Oct 05 '22 13:10 yahayahu

@yahayahu would you please provide a simple example of useOnClickOutside on how to use that

n-rezaei avatar Oct 05 '22 15:10 n-rezaei

@n-rezaei My case with reactstrap. I was created example on codesandbox. I added comment in Datepicker.jsx file for u.

yahayahu avatar Oct 05 '22 15:10 yahayahu

I'm having the same issue with Chakra-UI modal.

ifeora-emeka avatar Oct 14 '22 01:10 ifeora-emeka

@n-rezaei My case with reactstrap. I was created example on codesandbox. I added comment in Datepicker.jsx file for u.

You're the best, it works.

ifeora-emeka avatar Oct 14 '22 01:10 ifeora-emeka