Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit 8881dfd

Browse files
authored
Correctly check for IME Action when processing the done key. Fixes #1816 (#1827)
1 parent e2eec13 commit 8881dfd

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/KeyboardWidget.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ protected void onDismiss() {
387387

388388
@Override
389389
public void onPress(int primaryCode) {
390-
Log.d("VRB", "Keyboard onPress " + primaryCode);
390+
Log.d(LOGTAG, "Keyboard onPress " + primaryCode);
391391
}
392392

393393
@Override
@@ -447,7 +447,7 @@ public void onRelease(int primaryCode) {
447447

448448
@Override
449449
public void onKey(int primaryCode, int[] keyCodes, boolean hasPopup) {
450-
Log.d("VRB", "Keyboard onPress++ " + primaryCode);
450+
Log.d(LOGTAG, "Keyboard onPress++ " + primaryCode);
451451
switch (primaryCode) {
452452
case Keyboard.KEYCODE_MODE_CHANGE:
453453
handleModeChange();
@@ -716,8 +716,9 @@ private void handleDone() {
716716
final int action = mEditorInfo.imeOptions & EditorInfo.IME_MASK_ACTION;
717717
postInputCommand(() -> connection.performEditorAction(action));
718718

719-
boolean hide = (action & (EditorInfo.IME_ACTION_DONE | EditorInfo.IME_ACTION_GO |
720-
EditorInfo.IME_ACTION_SEARCH | EditorInfo.IME_ACTION_SEND)) != 0;
719+
boolean hide = (action == EditorInfo.IME_ACTION_DONE) || (action == EditorInfo.IME_ACTION_GO) ||
720+
(action == EditorInfo.IME_ACTION_SEARCH) || (action == EditorInfo.IME_ACTION_SEND);
721+
721722
if (hide && mFocusedView != null) {
722723
mFocusedView.clearFocus();
723724
}

0 commit comments

Comments
 (0)