From fda536b949649d0a36cb5b2cfc451e23b0a6ee88 Mon Sep 17 00:00:00 2001 From: Murillo Nicacio de Maraes Date: Tue, 28 Jul 2020 16:21:20 +0100 Subject: [PATCH] fix: time picker sometimes resets to previous value (#234) * DateTimePicker iOS fix * [CHANGELOG] DateTimePicker iOS fix * Update CHANGELOG.md Co-authored-by: Vojtech Novak --- ios/RNDateTimePicker.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ios/RNDateTimePicker.m b/ios/RNDateTimePicker.m index ad3a9b36..8d1737d1 100644 --- a/ios/RNDateTimePicker.m +++ b/ios/RNDateTimePicker.m @@ -51,4 +51,11 @@ - (void)setMinuteInterval:(NSInteger)minuteInterval _reactMinuteInterval = minuteInterval; } +- (void)setDate:(NSDate *)date { + // Need to avoid the case where values coming back through the bridge trigger a new valueChanged event + if (![self.date isEqualToDate:date]) { + [super setDate:date]; + } +} + @end