@@ -1328,14 +1328,13 @@ - (void)slk_willShowOrHideKeyboard:(NSNotification *)notification
1328
1328
}
1329
1329
}
1330
1330
1331
- NSInteger curve = [notification.userInfo[UIKeyboardAnimationCurveUserInfoKey] integerValue ];
1332
- NSTimeInterval duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] doubleValue ];
1333
-
1334
- CGRect beginFrame = [notification.userInfo[UIKeyboardFrameBeginUserInfoKey] CGRectValue ];
1335
- CGRect endFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue ];
1336
-
1337
1331
SLKKeyboardStatus status = [self slk_keyboardStatusForNotification: notification];
1338
1332
1333
+ // Skips if it's the current status
1334
+ if (self.keyboardStatus == status) {
1335
+ return ;
1336
+ }
1337
+
1339
1338
// Programatically stops scrolling before updating the view constraints (to avoid scrolling glitch).
1340
1339
if (status == SLKKeyboardStatusWillShow) {
1341
1340
[self .scrollViewProxy slk_stopScrolling ];
@@ -1356,6 +1355,12 @@ - (void)slk_willShowOrHideKeyboard:(NSNotification *)notification
1356
1355
[self slk_postKeyboarStatusNotification: notification];
1357
1356
}
1358
1357
1358
+ NSInteger curve = [notification.userInfo[UIKeyboardAnimationCurveUserInfoKey] integerValue ];
1359
+ NSTimeInterval duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] doubleValue ];
1360
+
1361
+ CGRect beginFrame = [notification.userInfo[UIKeyboardFrameBeginUserInfoKey] CGRectValue ];
1362
+ CGRect endFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue ];
1363
+
1359
1364
void (^animations)() = ^void () {
1360
1365
[self slk_scrollToBottomIfNeeded ];
1361
1366
};
@@ -1395,7 +1400,8 @@ - (void)slk_didShowOrHideKeyboard:(NSNotification *)notification
1395
1400
1396
1401
SLKKeyboardStatus status = [self slk_keyboardStatusForNotification: notification];
1397
1402
1398
- if (status == SLKKeyboardStatusDidHide) {
1403
+ // Skips if it's the current status
1404
+ if (self.keyboardStatus == status) {
1399
1405
return ;
1400
1406
}
1401
1407
0 commit comments