Skip to content

[Bug]: 🐛 Crash on Samsung Devices When Rotating Screen with react-native-date-picker #913

Open
@saif-techversant

Description

@saif-techversant

Describe the bug

Bug Description

When using react-native-date-picker on Samsung devices, the app crashes upon screen rotation (changing device orientation) while the date picker is open. This issue persists even when the date picker is used inside a modal (using the modal prop).

The crash seems to be specific to Samsung devices and occurs regardless of whether a modal or portal is used. All combinations tested result in a crash only on Samsung; the behavior is stable on other OEMs.


✅ Tested Setup

  • Device: Samsung (multiple models)
  • React Native: 0.76.9
  • react-native-date-picker: ^5.0.12
  • react-native-modal: ^13.0.1

📋 Code Snippet

{showDatePicker && (
  <DatePicker
    modal
    open={showDatePicker}
    date={expiryDate || new Date()}
    onConfirm={handleDateChange}
    onCancel={() => setShowDatePicker(false)}
    mode="date"
    minimumDate={new Date()}
  />
)}

📌 Notes

  • The issue was not observed on other device brands.
  • I also tested with and without portals and modals – the issue still persists on Samsung.

Expected behavior

  • The DatePicker should remain stable and functional when the device orientation changes.
  • Rotating the screen should not cause a crash, regardless of the device manufacturer.
  • The modal should either adjust layout or re-render gracefully during orientation changes on all Android devices, including Samsung.

To Reproduce

{showDatePicker && (
  <DatePicker
    modal
    open={showDatePicker}
    date={expiryDate || new Date()}
    onConfirm={handleDateChange}
    onCancel={() => setShowDatePicker(false)}
    mode="date"
    minimumDate={new Date()}
  />
)}

Operating System

  • Android
  • iOS

React Native Version

0.76.9

Expo Version (if applicable)

No response

react-native-date-picker version

5.0.12

React Native Architecture

  • Old Architecture (Paper)
  • New Architecture (Fabric)

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions