Control calendar opening and closing logic
mainInstead of using the boolean closeCalendar prop, it is recommended to use the shouldOpenCalendar and shouldCloseCalendar functions for fine-grained control over the calendar lifecycle.
These functions receive a reason object, allowing you to decide whether to allow the action based on how it was triggered.
Close Reasons (CloseReason):
'buttonClick': User clicked the calendar toggle button.'escape': User pressed the Escape key.'outsideAction': User clicked or touched outside the component.'select': User selected a date.
Open Reasons (OpenReason):
'buttonClick': User clicked the calendar toggle button.'focus': User focused the input field.