From 699e69b9fec3fd3b19feb4770a3a9e5fa4c4a0a7 Mon Sep 17 00:00:00 2001 From: Ignacio Romero Zurbuchen Date: Wed, 30 Mar 2016 12:49:07 -0700 Subject: [PATCH] Let's not call forceTextInputbarAdjustmentForResponder: if the current first responder is nil This fixes an edge case where the text input would not follow the keyboard if the textView isn't yet first responder, on a cold launch and tapping right away on the textView. --- Source/SLKTextViewController.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/SLKTextViewController.m b/Source/SLKTextViewController.m index 675a738b..d5ce406a 100644 --- a/Source/SLKTextViewController.m +++ b/Source/SLKTextViewController.m @@ -1335,7 +1335,7 @@ - (void)slk_willShowOrHideKeyboard:(NSNotification *)notification UIResponder *currentResponder = [UIResponder slk_currentFirstResponder]; // Skips this it's not the expected textView and shouldn't force adjustment of the text input bar. // This will also dismiss the text input bar if it's visible, and exit auto-completion mode if enabled. - if (![currentResponder isEqual:self.textView]) { + if (currentResponder && ![currentResponder isEqual:self.textView]) { // Detect the current first responder. If there is no first responder, we should just ignore these notifications. if (![self forceTextInputbarAdjustmentForResponder:currentResponder]) { return [self slk_dismissTextInputbarIfNeeded];