Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

isDarkModeEnabled doesn't work on spinner in iOS #749

Open
darshan-palm opened this issue May 16, 2024 · 0 comments
Open

isDarkModeEnabled doesn't work on spinner in iOS #749

darshan-palm opened this issue May 16, 2024 · 0 comments

Comments

@darshan-palm
Copy link

Hi! 馃憢

Firstly, thanks for your work on this project! 馃檪

The prop "isDarkModeEnabled" doesn't have an effect on the internal Picker theme in iOS.
Here is the diff that solved my problem:

diff --git a/node_modules/react-native-modal-datetime-picker/src/DateTimePickerModal.ios.js b/node_modules/react-native-modal-datetime-picker/src/DateTimePickerModal.ios.js
index 6ef0b0a..89a5bb6 100644
--- a/node_modules/react-native-modal-datetime-picker/src/DateTimePickerModal.ios.js
+++ b/node_modules/react-native-modal-datetime-picker/src/DateTimePickerModal.ios.js
@@ -178,6 +178,7 @@ export class DateTimePickerModal extends React.PureComponent {
               display={display || "spinner"}
               {...otherProps}
               value={this.state.currentDate}
+              themeVariant={_isDarkModeEnabled ? 'dark' : 'light'}
               onChange={this.handleChange}
               // Recent versions @react-native-community/datetimepicker (at least starting with 6.7.0)
               // have a peculiar iOS behaviour where sometimes, for example in react-native Modal,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant