From c015f485c21057505cfb701a725d782d0b2fa220 Mon Sep 17 00:00:00 2001 From: Peter Argany Date: Fri, 25 Sep 2020 11:34:54 -0700 Subject: [PATCH] Workaround for Date Picker in iOS14 Summary: iOS14 has introduced new styles for date picker. The default new calendar style breaks the old spinner type style. This is a workaround to keep the spinner style as a default, until the calendar style is properly supported. According to [this github comment](https://github.com/react-native-community/datetimepicker/issues/285) it works well. This will fix DatePicker for both Fabric and Paper, since Fabric uses the interop layer to render it. Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D23935328 fbshipit-source-id: 1a7fadba274e0537f0ac4ced60e23e7c809d57dc --- React/Views/RCTDatePicker.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/React/Views/RCTDatePicker.m b/React/Views/RCTDatePicker.m index 1a921c556a..3ba934d152 100644 --- a/React/Views/RCTDatePicker.m +++ b/React/Views/RCTDatePicker.m @@ -24,6 +24,10 @@ if ((self = [super initWithFrame:frame])) { [self addTarget:self action:@selector(didChange) forControlEvents:UIControlEventValueChanged]; _reactMinuteInterval = 1; + + if (@available(iOS 14, *)) { + self.preferredDatePickerStyle = UIDatePickerStyleWheels; + } } return self; }