React-native-modal-datetime-picker: Dates are not visible on iOS device while dark mode active

Created on 20 Apr 2020  路  7Comments  路  Source: mmazzarolo/react-native-modal-datetime-picker

Environment

System:
OS: macOS 10.15.4
CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
Memory: 63.06 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.16.1 - /usr/local/bin/node
npm: 6.13.4 - /usr/local/bin/npm
SDKs:
iOS SDK:
Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
IDEs:
Android Studio: 3.6 AI-192.7142.36.36.6241897
Xcode: 11.4/11E146 - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.5 => 0.61.5

Platforms

iOS

Description

When opening date picker in iOS while dark mode is activated, dates are not visible but still selectable. After turning off dark mode labels are again visible.

Screenshot

https://snipboard.io/VAgRel.jpg

bug

Most helpful comment

Please read the Readme.
There is an answer.

Thank you.

All 7 comments

Please read the Readme.
There is an answer.

Thank you.

Can confirm. Thanks @shlaing :)

Thank you for the answer! I totally missed that.

So, what is the answer?

there is a variable called "isDarkModeEnabled" that you able to TRUE if you have darkMode

Worth to note is that if you have class based components you will get errors calling the following line specified in the docs (since it is a "hook")
const colorScheme = useColorScheme();

I solved it by attaching an event listener as was provided by react natives docs:
https://github.com/facebook/react-native/blob/master/RNTester/js/examples/Appearance/AppearanceExample.js

@jinguohao1991 I'm fixing this now for our iOS app ;-)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

EdmundMai picture EdmundMai  路  7Comments

ketanpatel3377 picture ketanpatel3377  路  5Comments

cgathergood picture cgathergood  路  5Comments

crobinson42 picture crobinson42  路  6Comments

gopikasireddy202 picture gopikasireddy202  路  3Comments