react-native-datetimepicker / datetimepicker

React Native date & time picker component for iOS, Android and Windows

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add onClose Event for Picker Components to Detect Closure

saqlaan opened this issue · comments

Feature request

Hi,

Currently, there is no straightforward way to detect when a picker component (such as a date picker or time picker) is closed, regardless of how it is closed (e.g., by selecting a value, tapping outside the picker, or pressing a confirm or cancel button). Having an onClose event would provide developers with a convenient way to perform actions when the picker is closed, enabling better control and customization of user interactions.

Thank you very much.

Did you found any solution on it?

Hello and thanks for asking,
please see the docs for onChange, this callback should allow what you're looking for: https://github.com/react-native-datetimepicker/datetimepicker?tab=readme-ov-file#onchange-optional

Thank you 🙂