mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
Fix reviewer shortcuts being inaccessible due to IME
Only tested on Windows, but hopefully resolves the Linux issue as well. Closes #1952
This commit is contained in:
parent
39d59caa48
commit
5bf031f1e3
2 changed files with 8 additions and 3 deletions
|
@ -653,6 +653,12 @@ class Reviewer:
|
||||||
def _onTypedAnswer(self, val: None) -> None:
|
def _onTypedAnswer(self, val: None) -> None:
|
||||||
self.typedAnswer = val or ""
|
self.typedAnswer = val or ""
|
||||||
self._showAnswer()
|
self._showAnswer()
|
||||||
|
self.unfocus_typing_box()
|
||||||
|
|
||||||
|
def unfocus_typing_box(self) -> None:
|
||||||
|
# shifting focus to the bottom area works around a WebEngine/IME bug
|
||||||
|
# https://github.com/ankitects/anki/issues/1952
|
||||||
|
self.bottom.web.setFocus()
|
||||||
|
|
||||||
# Bottom bar
|
# Bottom bar
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
|
@ -293,9 +293,8 @@ class AnkiWebView(QWebEngineView):
|
||||||
w.close()
|
w.close()
|
||||||
else:
|
else:
|
||||||
# in the main window, removes focus from type in area
|
# in the main window, removes focus from type in area
|
||||||
parent = self.parent()
|
if mw.state == "review":
|
||||||
assert isinstance(parent, QWidget)
|
mw.reviewer.unfocus_typing_box()
|
||||||
parent.setFocus()
|
|
||||||
break
|
break
|
||||||
w = w.parent()
|
w = w.parent()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue