mmazzarolo / react-native-modal-datetime-picker

A React-Native datetime-picker for Android and iOS
MIT License
2.98k stars 399 forks source link

Date picker does not rotate on Android when screen rotates from landscape to portrait #758

Open Anahita-Fakhravar opened 3 months ago

Anahita-Fakhravar commented 3 months ago

Environment

System: OS: macOS 14.3.1 CPU: (8) arm64 Apple M1 Shell: version: "5.9" Binaries: Node: version: 18.14.1 Yarn: version: 4.1.1 npm: version: 9.3.1 Managers: Android SDK: API Levels: 16 - 34 IDEs: Android Studio: 2023.2 AI-232.10300.40.2321.11567975 Xcode: version: 15.4/15F31d Languages: Java: version: 17.0.10 Ruby: version: 2.7.6

Platforms

Android only

Versions

Description

On Android, when the app is in landscape mode and I open the date picker, if I rotate the device back to portrait mode while the date picker is still open, the header remains aligned to the left, causing it to display incorrectly in portrait orientation.

Reproducible Demo

This is a minimum reproduction git repository:

https://github.com/Anahita-Fakhravar/DatePickerIssue/tree/master

Lunch the project and open the date picker in landscape mode:

photo_2024-07-31 17 18 41

Then rotate back to portrait:

photo_2024-07-31 17 18 45

This issue has been previously mentioned. It appears that you opened the date picker in portrait mode and then rotated it to landscape, which is not the problem. Please test it the other way around, starting in landscape and then switching to portrait. Below are the issue links:

https://github.com/react-native-datetimepicker/datetimepicker/issues/49

https://github.com/react-native-datetimepicker/datetimepicker/issues/332