ionic-team / cordova-plugin-ionic-keyboard

Keyboard Plugin for Cordova
Other
191 stars 177 forks source link

iOS 13 Dark Mode issues #141

Open randnetdd opened 4 years ago

randnetdd commented 4 years ago

KeyboardStyle will be Light from next time when you open the keyboard with APPEARANCE set to Dark on iOS 13. It is probably because keyboardStyle is overwritten by onKeyboardWillShow.

- (void)onKeyboardWillShow:(NSNotification *)note
{
    if (hideTimer != nil) {
        [hideTimer invalidate];
    }
    CGRect rect = [[note.userInfo valueForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
    double height = rect.size.height;

    if (self.isWK) {
        double duration = [[note.userInfo valueForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue];
        [self setKeyboardHeight:height delay:duration+0.2];
        [self resetScrollView];
    }

    if (self.keyboardStyle) { // <---------This check--------------
        [self setKeyboardStyle:self.keyboardStyle];
    }

    NSString *js = [NSString stringWithFormat:@"Keyboard.fireOnShowing(%d);", (int)height];
    [self.commandDelegate evalJs:js];
}