Skip to content

IOS App crash when try to show time Picker after hide DatePicker  #951

Closed

Description

@luucambo-hue

Bug report

Summary

App crash when try opening timePicker after hiding DatePicker

Reproducible sample code

BoTest.zip

Steps to reproduce

I use 2 RNDatePickers , one is with date mode, another is with time mode.
I have a button to show / hide datePicker and a button show timePicker.
I set defaultValue of timePicker 1/1/1980 00:00:00 ( in Date type)
I have minimumDate for datePicker is today
When I set value of datePicker to the day which is not today (tomorrow etc)
then I hide datePicker. I click to show timePicker => App close

Environment info

Expo go SDK 52, Client version 1017638

npx react-native info output:
react-native depends on @react-native-community/cli for cli commands. To fix update your package.json to include:

"devDependencies": {
"@react-native-community/cli": "latest",
}

Time zone: (UTC + 07:00) BangKok, Hanoi, Jakarta
"@react-native-community/datetimepicker": "^8.2.0"
IOS 16.7.10
Iphone 8 plus

Activity

  1. ShunL12324 commented on Dec 21, 2024

    @ShunL12324

    Same issue here, use two buttons in one page, each button for a date setting, but after click the first button, click the second button result app crash

  2. LiaoXiang2026 commented on Jan 5, 2025

    @LiaoXiang2026

    我也遇到了,好多问题

  3. ShunL12324 commented on Jan 11, 2025

    @ShunL12324

    Same issue here, use two buttons in one page, each button for a date setting, but after click the first button, click the second button result app crash

    if minimumDate and maximumDate not set, the app won't crash

  4. longprao commented on Jan 20, 2025

    @longprao

    Confirmed the same issue: if I se 2 datepickers in one place, and have maximumDate or minimumDate in either, then opening/closing the 2 datepickers will always crash

  5. JenilynnB commented on Feb 20, 2025

    @JenilynnB

    Having the same issue with the app crashing when setting the minimumDate and maximumDate in different locations.

  6. luihugo commented on Feb 21, 2025

    @luihugo

    any feedback on this?

  7. luucambo-hue commented on Jun 5, 2025

    @luucambo-hue
    Author

    this can be fixed by using same mode picker if there is 2 pickers in one place

  8. koz-spyro commented on Jun 13, 2025

    @koz-spyro

    this can be fixed by using same mode picker if there is 2 pickers in one place

    That workaround is not possible to utilize in, for example, Storybook with different stories where you have to render plenty pickers by default. In my case it forces me to somehow use 1 picker with every possible parameter in 1 story which is pretty bad.

  9. luucambo-hue commented on Jun 17, 2025

    @luucambo-hue
    Author

    @koz-spyro another work around is use current date in time picker, if time picker and date picker in one place.

  10. dannybit commented on Jul 10, 2025

    @dannybit

    I am seeing the same issue. This only happens if I set maximumDate or minimumDate in either DateTImePickers.

  11. MohamedMegdich1 commented on Aug 1, 2025

    @MohamedMegdich1

    the same

  12. kalisoft93 commented on Aug 13, 2025

    @kalisoft93

    Same here, could you please fix it? this is pending from the last year, can't use validation...

  13. ahmadaccino commented on Aug 18, 2025

    @ahmadaccino

    still happening. i dont even have a maximumDate or minimumDate set

  14. luucambo-hue commented on Aug 18, 2025

    @luucambo-hue
    Author

    All datetimepicker should be same display mode ( ex: all are spinner) . This is a walk around.

  15. luucambo-hue commented on Aug 20, 2025

    @luucambo-hue
    Author

    One of stupid thing that is when choosing a date from screen A, and going to screen B , i choose day 31/5/2025 => result is 30/5/2025 :->

  16. GaelCO commented on Nov 3, 2025

    @GaelCO

    Still happening with version 8.5.0.

    `Last Exception Backtrace:
    0 CoreFoundation 0x18049111c __exceptionPreprocess + 160
    1 libobjc.A.dylib 0x18008412c objc_exception_throw + 56
    2 Foundation 0x180d1163c _userInfoForFileAndLine + 0
    3 UIKitCore 0x184dac3c8 -[UICalendarView _setVisibleMonth:animated:] + 304
    4 UIKitCore 0x184dac07c -[UICalendarView setVisibleDateComponents:animated:] + 316
    5 UIKitCore 0x18563b008 -[UICalendarSelectionSingleDate setSelectedDate:animated:] + 424
    6 UIKitCore 0x184848d58 -[_UIDatePickerCalendarView _updateSelectedDay:time:animated:notify:] + 600
    7 UIKitCore 0x1848482d0 -[_UIDatePickerCalendarView _updateDate] + 260
    8 UIKitCore 0x18484863c -[_UIDatePickerCalendarView _reload] + 40
    9 UIKitCore 0x1852a0770 -[UIDatePicker setMinimumDate:] + 216
    10 myapp.debug.dylib 0x10754caac -[RNDateTimePickerComponentView updatePropsForPicker:props:oldProps:] + 892
    11 myapp.debug.dylib 0x10754d630 -[RNDateTimePickerComponentView updateProps:oldProps:] + 64
    12 myapp.debug.dylib 0x1073f6260 RCTPerformMountInstructions(std::__1::vector<facebook::react::ShadowViewMutation, std::__1::allocatorfacebook::react::ShadowViewMutation> const&, RCTComponentViewRegistry*, RCTMountingTransactionObserverCoordinator&, int) + 1060
    13 myapp.debug.dylib 0x1073f5e30 -[RCTMountingManager performTransaction:]::$_1::operator()(facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&) const + 80
    14 myapp.debug.dylib 0x1073f5dd4 decltype(std::declval<-[RCTMountingManager performTransaction:]::$_1&>()(std::declval<facebook::react::MountingTransaction const&>(), std::declval<facebook::react::SurfaceTelemetry const&>())) std::__1::__invoke[abi:de200100]<-[RCTMountingManager performTransaction:]::$_1&, facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&>(-[RCTMountingManager performTransaction:]::$_1&, facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&) + 40
    15 myapp.debug.dylib 0x1073f5da0 void std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:de200100]<-[RCTMountingManager performTransaction:]::$_1&, facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&>(-[RCTMountingManager performTransaction:]::$_1&, facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&) + 40
    16 myapp.debug.dylib 0x1073f5d6c void std::__1::__invoke_r[abi:de200100]<void, -[RCTMountingManager performTransaction:]::$_1&, facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&>(-[RCTMountingManager performTransaction:]::$_1&, facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&) + 40
    17 myapp.debug.dylib 0x1073f5d38 std::__1::__function::__alloc_func<-[RCTMountingManager performTransaction:]::$_1, std::__1::allocator<-[RCTMountingManager performTransaction:]::$_1>, void (facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&)>::operator()[abi:de200100](facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&) + 40
    18 myapp.debug.dylib 0x1073f5570 std::__1::__function::__func<-[RCTMountingManager performTransaction:]::$_1, std::__1::allocator<-[RCTMountingManager performTransaction:]::$_1>, void (facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&)>::operator()(facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&) + 44
    19 myapp.debug.dylib 0x107c23c34 std::__1::__function::__value_func<void (facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&)>::operator()[abi:de200100](facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&) const + 76
    20 myapp.debug.dylib 0x107c22f54 std::__1::function<void (facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&)>::operator()(facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&) const + 40
    21 myapp.debug.dylib 0x107c22d88 facebook::react::TelemetryController::pullTransaction(std::__1::function<void (facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&)> const&, std::__1::function<void (facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&)> const&, std::__1::function<void (facebook::react::MountingTransaction const&, facebook::react::SurfaceTelemetry const&)> const&) const + 300
    22 myapp.debug.dylib 0x1073ee68c -[RCTMountingManager performTransaction:] + 588
    23 myapp.debug.dylib 0x1073ee35c -[RCTMountingManager initiateTransaction:] + 496
    24 myapp.debug.dylib 0x1073edccc __42-[RCTMountingManager scheduleTransaction:]_block_invoke + 348
    25 myapp.debug.dylib 0x1078904e4 __RCTExecuteOnMainQueue_block_invoke + 40
    26 libdispatch.dylib 0x18016b4f4 _dispatch_call_block_and_release + 24
    27 libdispatch.dylib 0x18016cd3c _dispatch_client_callout + 16
    28 libdispatch.dylib 0x18017bb24 _dispatch_main_queue_drain + 1272
    29 libdispatch.dylib 0x18017b61c _dispatch_main_queue_callback_4CF + 40
    30 CoreFoundation 0x1803f1a30 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 12
    31 CoreFoundation 0x1803ec148 __CFRunLoopRun + 1936
    32 CoreFoundation 0x1803eb5a4 CFRunLoopRunSpecific + 572
    33 GraphicsServices 0x18e9fbae4 GSEventRunModal + 160
    34 UIKitCore 0x1852f02e4 -[UIApplication _run] + 868
    35 UIKitCore 0x1852f3f5c UIApplicationMain + 124
    36 myapp.debug.dylib 0x106d1209c __debug_main_executable_dylib_entry_point + 64 (AppDelegate.swift:11)
    37 ??? 0x1021f5544 ???
    38 dyld 0x1024d8d54 start + 7184

    Thread 0 Crashed:
    0 libsystem_kernel.dylib 0x10218485c __pthread_kill + 8
    1 libsystem_pthread.dylib 0x1023922a8 pthread_kill + 264
    2 libsystem_c.dylib 0x180160648 __abort + 112
    3 libsystem_c.dylib 0x1801605d8 abort + 116
    4 libc++abi.dylib 0x18028ec78 abort_message + 128
    5 libc++abi.dylib 0x180280198 demangling_terminate_handler() + 300
    6 libobjc.A.dylib 0x18005fbf0 _objc_terminate() + 124
    7 myapp.debug.dylib 0x10719fd04 FIRCLSTerminateHandler() + 404
    8 libc++abi.dylib 0x18028e150 std::__terminate(void (*)()) + 12
    9 libc++abi.dylib 0x18028e100 std::terminate() + 52
    10 libdispatch.dylib 0x18016cd50 _dispatch_client_callout + 36
    11 libdispatch.dylib 0x18017bb24 _dispatch_main_queue_drain + 1272
    12 libdispatch.dylib 0x18017b61c _dispatch_main_queue_callback_4CF + 40
    13 CoreFoundation 0x1803f1a30 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 12
    14 CoreFoundation 0x1803ec148 __CFRunLoopRun + 1936
    15 CoreFoundation 0x1803eb5a4 CFRunLoopRunSpecific + 572
    16 GraphicsServices 0x18e9fbae4 GSEventRunModal + 160
    17 UIKitCore 0x1852f02e4 -[UIApplication _run] + 868
    18 UIKitCore 0x1852f3f5c UIApplicationMain + 124
    19 myapp.debug.dylib 0x106d1209c __debug_main_executable_dylib_entry_point + 64 (AppDelegate.swift:11)
    20 ??? 0x1021f5544 ???
    21 dyld 0x1024d8d54 start + 7184`

  17. GaelCO commented on Nov 25, 2025

    @GaelCO

    Seems to be fixed with version 8.5.1 and #1026

  18. sterlingwes commented on Nov 26, 2025

    @sterlingwes
    Collaborator

    Thanks @GaelCO for confirming. Skimming this thread it does seem to be the same issue. If anyone here is having the same problem with 8.5.1 please open a new issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions