File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1325,13 +1325,17 @@ - (void)slk_willShowOrHideKeyboard:(NSNotification *)notification
13251325 }
13261326
13271327 UIResponder *currentResponder = [UIResponder slk_currentFirstResponder ];
1328- // Skips this it's not the expected textView and shouldn't force adjustment of the text input bar.
1328+
1329+ // Detects the current first responder. Ignores these notifications when no valid responder is detected.
1330+ if (!currentResponder) {
1331+ return ;
1332+ }
1333+
1334+ // Skips if it's not the expected textView and shouldn't force adjustment of the text input bar.
13291335 // This will also dismiss the text input bar if it's visible, and exit auto-completion mode if enabled.
1330- if (currentResponder && ![currentResponder isEqual: self .textView]) {
1331- // Detect the current first responder. If there is no first responder, we should just ignore these notifications.
1332- if (![self forceTextInputbarAdjustmentForResponder: currentResponder]) {
1333- return [self slk_dismissTextInputbarIfNeeded ];
1334- }
1336+ if (![currentResponder isEqual: self .textView] && ![self forceTextInputbarAdjustmentForResponder: currentResponder]) {
1337+ [self slk_dismissTextInputbarIfNeeded ];
1338+ return ;
13351339 }
13361340
13371341 SLKKeyboardStatus status = [self slk_keyboardStatusForNotification: notification];
You can’t perform that action at this time.
0 commit comments