Skip to content

Commit

Permalink
fix: reset to original state when restarting input in the same view
Browse files Browse the repository at this point in the history
Clear any composing input or view when input is restarted in the same
text view, thus ensure a fresh input UI.

Fixes #1134
  • Loading branch information
goofyz authored and Bambooin committed Dec 7, 2023
1 parent 0bd141d commit f2d7792
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/src/main/java/com/osfans/trime/ime/core/Trime.java
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,7 @@ private boolean performEnter(int keyCode) { // 回車
}

/** 模擬PC鍵盤中Esc鍵的功能:清除輸入的編碼和候選項 */
private void performEscape() {
public void performEscape() {
if (isComposing()) textInputManager.onKey(KeyEvent.KEYCODE_ESCAPE, 0);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ class TextInputManager private constructor() :
) {
super.onStartInputView(instance, restarting)
Trime.getService().selectLiquidKeyboard(-1)
if (restarting) {
trime.performEscape()
}
isComposable = false
var tempAsciiMode = if (shouldResetAsciiMode) false else null
val keyboardType =
Expand Down

0 comments on commit f2d7792

Please sign in to comment.