Skip to content

Commit b943db4

Browse files
mdvaccafacebook-github-bot
authored andcommittedMar 25, 2019
Fix IllegalStateException when tapping next on Android Keyboard
Summary: This diff fixes an IllegalStateException that is thrown when the user click is on a edit text and tap 'Next' on the keyboard to focus on the next view, but the next view is hidden. Reviewed By: lunaleaps, mmmulani Differential Revision: D14598410 fbshipit-source-id: 2999cc468ed24bedff163eedcfaec50f6ee005d6
1 parent 64f3a87 commit b943db4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
 

‎ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
package com.facebook.react.views.textinput;
99

10+
import static android.view.View.FOCUS_FORWARD;
11+
1012
import android.annotation.TargetApi;
1113
import android.graphics.PorterDuff;
1214
import android.graphics.Typeface;
@@ -896,6 +898,12 @@ public boolean onEditorAction(TextView v, int actionId, KeyEvent keyEvent) {
896898

897899
// Prevent default behavior except when we want it to insert a newline.
898900
return blurOnSubmit || !isMultiline;
901+
} else if (actionId == EditorInfo.IME_ACTION_NEXT) {
902+
View v1 = v.focusSearch(FOCUS_FORWARD);
903+
if (v1 != null && !v.requestFocus(FOCUS_FORWARD)) {
904+
return true;
905+
}
906+
return false;
899907
}
900908

901909
return true;

0 commit comments

Comments
 (0)