Switch back to clearing MathJax preview on blur

This means two clicks are required again, but that's the lesser of two
evils:

https://forums.ankiweb.net/t/anki-2-1-55-beta-mathjax-preview/23529/8

Better fixes welcome :-)
This commit is contained in:
Damien Elmes 2022-10-12 14:56:38 +10:00
parent 29b2a2b35c
commit e14f87ba99
2 changed files with 2 additions and 5 deletions

View File

@ -99,7 +99,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
{configuration}
bind:api={codeMirror}
on:change={({ detail: mathjaxText }) => code.set(mathjaxText)}
on:tab
on:blur
/>
</div>

View File

@ -192,10 +192,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
placeHandle(true);
await resetHandle();
}}
on:tab={async () => {
// Instead of resetting on blur, we reset on tab
// Otherwise, when clicking from Mathjax element to another,
// the user has to click twice (focus is called before blur?)
on:blur={async () => {
await resetHandle();
}}
let:editor={mathjaxEditor}