mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -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:
|
||||
self.typedAnswer = val or ""
|
||||
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
|
||||
##########################################################################
|
||||
|
|
|
@ -293,9 +293,8 @@ class AnkiWebView(QWebEngineView):
|
|||
w.close()
|
||||
else:
|
||||
# in the main window, removes focus from type in area
|
||||
parent = self.parent()
|
||||
assert isinstance(parent, QWidget)
|
||||
parent.setFocus()
|
||||
if mw.state == "review":
|
||||
mw.reviewer.unfocus_typing_box()
|
||||
break
|
||||
w = w.parent()
|
||||
|
||||
|
|
Loading…
Reference in a new issue