request FlutterView focus when setting a platform view text client (flutter/engine#9366)

This commit is contained in:
Amir Hardon 2019-06-18 19:05:36 -07:00 committed by GitHub
parent ce51a70363
commit 4ad78e92cd

View File

@ -262,6 +262,10 @@ public class TextInputPlugin {
}
private void setPlatformViewTextInputClient(int platformViewId) {
// We need to make sure that the Flutter view is focused so that no imm operations get short circuited.
// Not asking for focus here specifically manifested in a but on API 28 devices where the platform view's
// request to show a keyboard was ignored.
mView.requestFocus();
inputTarget = new InputTarget(InputTarget.Type.PLATFORM_VIEW, platformViewId);
mImm.restartInput(mView);
mRestartInputPending = false;