From fcce8d1adf4e30820fc67cbf0841c51fe5d38d8d Mon Sep 17 00:00:00 2001 From: Manuel Martin Date: Tue, 7 Jul 2020 18:09:51 +0200 Subject: [PATCH] Fixes #3637 Null check the alphabetic Caps Keyboard when switching shift (#3639) * Null check the alphabetic Caps Keyboard when switching shift * Return to alphabetic Thai keyboard after inserting a character --- .../org/mozilla/vrbrowser/ui/widgets/KeyboardWidget.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/KeyboardWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/KeyboardWidget.java index 391d669e7..d238f565a 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/KeyboardWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/KeyboardWidget.java @@ -746,7 +746,10 @@ private void handleShift(boolean isShifted) { if (mKeyboardView.getKeyboard() != getSymbolsKeyboard()) { if (isShifted || mIsCapsLock) { - mKeyboardView.setKeyboard(mCurrentKeyboard.getAlphabeticCapKeyboard()); + if (mCurrentKeyboard.getAlphabeticCapKeyboard() != null) { + mKeyboardView.setKeyboard(mCurrentKeyboard.getAlphabeticCapKeyboard()); + } + } else { mKeyboardView.setKeyboard(mCurrentKeyboard.getAlphabeticKeyboard()); } @@ -1046,7 +1049,7 @@ private void handleText(String aText, boolean skipCase) { postInputCommand(() -> connection.commitText(text, 1)); } - if (!mIsCapsLock && mCurrentKeyboard.getAlphabeticCapKeyboard() == null) { + if (!mIsCapsLock) { handleShift(false); }