Skip to content

Commit

Permalink
fix: time picker sometimes resets to previous value (#234)
Browse files Browse the repository at this point in the history
* DateTimePicker iOS fix

* [CHANGELOG] DateTimePicker iOS fix

* Update CHANGELOG.md

Co-authored-by: Vojtech Novak <[email protected]>
  • Loading branch information
mnmaraes and vonovak authored Jul 28, 2020
1 parent fd5629b commit fda536b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ios/RNDateTimePicker.m
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit fda536b

Please sign in to comment.