[Bug] Field "type" loses focus when leaving the window

I found this bug on the new UI of anki (version 2.1.55 and onwards). I checked on github and it says I should report bugs on this forum, so here I am.

So essentially, when you have a card with a template with the input field “type”, like:


When you are studying, and the card is shown for the first time:
The input has focus. Meaning, you can type in it.

But if for whatever reason the Anki window, loses focus itself. Let’s say you Alt+Tab into another window. And the go back to the Anki window, the input loses its focus:
And in order to type, you have to manually click it (or press tab), so it regains focus.

On version 2.1.54, this didn’t happen. And I tested it both on the Windows and Linux versions.

This bug is particularly annoying for me, because I use Ibus to change my input method between Latin and Japanese keyboard. And apparently ibus takes focus for a split second when I do that, causing anki to lose focus and my muscle memory to open like 5 different windows in anki because of shortcuts…

Hope, I was clear enough.
And thanks for the app!

This is happening here

Version <U+2068>2.1.58 (ab8b1465)<U+2069>
Python 3.9.15 Qt 6.3.2 PyQt 6.3.1

Workaround: pressing tab → focus towards the “type in” field

Thanks for the reports, both of you. I’ve just pushed a fix for this.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.