[Android] How to find "Cancel" button event handler?

Hello!
I use Expo v45, Managed workflow.

I’m using @react-native-community/datetimepicker in Android with mode ‘date’ to select date. The selection works fine, with button “ok” and “cancel”.

However, while I’m in charge to make an input that must initially like this:

--/--/----

And once its pressed for the 1st time, it must be initialized with a specific date value as follows:

28/08/2022

Also, the DatePicker element appears on the screen with that initial value.

Now the problem is: When I press cancel button, I want to reinitilize the value shown on the input, back to this:

--/--/----

Which implies an existence of a custom cancel event handler.

I tried with onTouchCanel() but it didn’t gave anything, even with console.log().

Note: I can share you a github link or expo snack if required.

This is a demo:
datepicker-issue

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.