Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-25580] Android: Prevent EVENT_RETURN firing twice #9652

Merged
merged 8 commits into from
Dec 14, 2017
Original file line number Diff line number Diff line change
Expand Up @@ -522,12 +522,15 @@ public boolean onEditorAction(TextView v, int actionId, KeyEvent keyEvent)
//this callback is triggered twice (except for keys that are mapped to EditorInfo.IME_ACTION_NEXT or EditorInfo.IME_ACTION_DONE). The first check is to deal with those keys - filter out
//one of the two callbacks, and the next checks deal with 'Next' and 'Done' callbacks, respectively.
//Refer to TiUIText.handleReturnKeyType(int) for a list of return keys that are mapped to EditorInfo.IME_ACTION_NEXT and EditorInfo.IME_ACTION_DONE.
// TIMOB-25580: EVENT_RETURN is handled in onTextChanged due to an Android bug starting in Jelly Bean. Keeping this implemented will fire EVENT_RETURN twice.
// NOTE: this doesn't seem to fire on emulators, only onTextChanged does.
/*
if ((actionId == EditorInfo.IME_NULL && keyEvent != null) ||
actionId == EditorInfo.IME_ACTION_NEXT ||
actionId == EditorInfo.IME_ACTION_DONE ) {
fireEvent(TiC.EVENT_RETURN, data);
}

*/

return false;
}
Expand Down