react-native-datetimepicker / datetimepicker

React Native date & time picker component for iOS, Android and Windows
MIT License
2.37k stars 387 forks source link

Add onClose Event for Picker Components to Detect Closure #880

Closed saqlaan closed 3 weeks ago

saqlaan commented 1 month ago

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.

ErMapsh commented 1 month ago

Did you found any solution on it?

vonovak commented 3 weeks ago

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 🙂