[Bug] Mathjax editor popup loose focus (close) when releasing click selection outside popup

(Anki 2.1.60)

This happen when selecting text inside a MathJax popup:

  • Left click hold inside the popup
  • Maintain left click while dragging mouse to select
  • If the click is released outside the popup window, the window closes:

mathjax_loosing_focus

First I show example when releasing inside the popup, then outside.

This might sound nitpicking but this happened lots of times to me. At first I would not understand why the popup kept closing suddenly on me. I think it is not so usual to loose focus, or close a UI element just on a mouse release. Considering the small size of the popup’s margin this forces the user to be very careful and slow.

There are also other less standard behaviors related to focus of the mathjax popup:

mathjax_loosing_focus2

  • First we left click down on some math and release the mouse: it opens a mathjax popup
  • without clicking anywhere and any Anki UI we move the cursor towards another software’s window
  • Left clicking on another app’s windows makes the popup disappear

This may be up for debate, but I usually don’t expect any sub-window of a program to close when left clicking on some unrelated program. (this prevents going smoothly back and forth two programs and forces you to re-open the sub-window/popup).

I would expect the popup to disappear only when clicking outside the popup.

Which brings me to the third issue: the popup bounding box is not fitted correctly,
and even clicking on the popup itself sometimes closes it:

mathjax_bbox_dontfit

As we can see in the above, only clicking in the textarea of the popup won’t close the window (as expected), but slightly clicking outside the text field, even though this is still graphically the popup, will close the popup.

I really love this new feature but it needs some polishing to be absolutely perfect ^^

1 Like

Please report this over on GitHub - ankitects/anki: Anki for desktop computers. The person who spearheaded this MathJax work is busy with other things these days, so it may take a while until anyone can look at it I’m afraid.

Done (it seems the issue were already reported I just added more details)

Thanks Arkan.