Skip to content

Commit fda536b

Browse files
mnmaraesvonovak
andauthored
fix: time picker sometimes resets to previous value (react-native-datetimepicker#234)
* DateTimePicker iOS fix * [CHANGELOG] DateTimePicker iOS fix * Update CHANGELOG.md Co-authored-by: Vojtech Novak <[email protected]>
1 parent fd5629b commit fda536b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ios/RNDateTimePicker.m

+7
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,11 @@ - (void)setMinuteInterval:(NSInteger)minuteInterval
5151
_reactMinuteInterval = minuteInterval;
5252
}
5353

54+
- (void)setDate:(NSDate *)date {
55+
// Need to avoid the case where values coming back through the bridge trigger a new valueChanged event
56+
if (![self.date isEqualToDate:date]) {
57+
[super setDate:date];
58+
}
59+
}
60+
5461
@end

0 commit comments

Comments
 (0)