Skip to content

Commit

Permalink
Hide keyboard in IOS on click date
Browse files Browse the repository at this point in the history
  • Loading branch information
usamadev17 committed Jul 11, 2023
1 parent 7601c14 commit de2e5e2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ios/RNDatePicker/DatePicker.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ - (UIColor *) colorFromHexCode:(NSString *)hexString {
- (instancetype)initWithFrame:(CGRect)frame
{
if ((self = [super initWithFrame:frame])) {
[self addTarget:self action:@selector(handleDatePickerTap) forControlEvents:UIControlEventEditingDidBegin];
[self addTarget:self action:@selector(didChange)
forControlEvents:UIControlEventValueChanged];
if(@available(iOS 13, *)) {
Expand All @@ -65,6 +66,10 @@ - (instancetype)initWithFrame:(CGRect)frame
return self;
}

- (void)handleDatePickerTap {
[self resignFirstResponder];
}

- (void)setColor:(NSString *)hexColor {
// Hex to int color
unsigned intColor = 0;
Expand Down

0 comments on commit de2e5e2

Please sign in to comment.