Skip to content

Commit

Permalink
Update InPlaceEditView.java for Enter Key issue 3850 (#3853)
Browse files Browse the repository at this point in the history
Second attempt to fix issue #3850 , when the Enter key is pressed the TextField loses focus, now I have added this condition to the code that if it is a multi-line TextArea then when the Enter key is pressed it wraps maintaining the focus on the TextField instead if it is a single line TextField it enters the onEditorAction() function
  • Loading branch information
ImmediandoSrl authored Nov 16, 2024
1 parent ce30484 commit b4185aa
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2160,6 +2160,10 @@ public boolean onKeyDown(int keyCode, KeyEvent event) {
case KeyEvent.KEYCODE_MENU:
endEditing(InPlaceEditView.REASON_SYSTEM_KEY, false, true, 0);
break;
case KeyEvent.KEYCODE_ENTER:
if (mEditText.mTextArea != null && mEditText.mTextArea.isSingleLineTextArea())
onEditorAction(EditorInfo.IME_ACTION_DONE);
break;
case KeyEvent.KEYCODE_ESCAPE:
endEditing(InPlaceEditView.REASON_IME_ACTION, false, true, EditorInfo.IME_ACTION_DONE, keyCode);
break;
Expand Down

0 comments on commit b4185aa

Please sign in to comment.