Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
Let's not call forceTextInputbarAdjustmentForResponder: if the curren…
Browse files Browse the repository at this point in the history
…t 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.
  • Loading branch information
Ignacio Romero Zurbuchen committed Mar 30, 2016
1 parent 01b5925 commit 699e69b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/SLKTextViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 699e69b

Please sign in to comment.