Revert "Prevent MathJax editor from closing unexpectedly when selecting text (#2484)"

This broke mouse selection of dropdowns, as code that set closeOnInsideClick never
got a click signal as the floating area is closed before the click fires.

https://forums.ankiweb.net/t/anki-2-1-62-beta-release-candidate/29302/21

This reverts commit e35a938368.
This commit is contained in:
Damien Elmes 2023-05-01 11:17:09 +10:00
parent fd509efc31
commit bd79a063ca
3 changed files with 6 additions and 6 deletions

View File

@ -17,7 +17,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import isClosingClick from "../sveltelib/closing-click"; import isClosingClick from "../sveltelib/closing-click";
import isClosingKeyup from "../sveltelib/closing-keyup"; import isClosingKeyup from "../sveltelib/closing-keyup";
import type { EventPredicateResult } from "../sveltelib/event-predicate"; import type { EventPredicateResult } from "../sveltelib/event-predicate";
import { documentKeyup, documentMouseDown } from "../sveltelib/event-store"; import { documentClick, documentKeyup } from "../sveltelib/event-store";
import portal from "../sveltelib/portal"; import portal from "../sveltelib/portal";
import type { PositioningCallback } from "../sveltelib/position/auto-update"; import type { PositioningCallback } from "../sveltelib/position/auto-update";
import autoUpdate from "../sveltelib/position/auto-update"; import autoUpdate from "../sveltelib/position/auto-update";
@ -134,7 +134,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
return; return;
} }
const closingClick = isClosingClick(documentMouseDown, { const closingClick = isClosingClick(documentClick, {
reference, reference,
floating, floating,
inside: closeOnInsideClick, inside: closeOnInsideClick,

View File

@ -17,7 +17,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import isClosingClick from "../sveltelib/closing-click"; import isClosingClick from "../sveltelib/closing-click";
import isClosingKeyup from "../sveltelib/closing-keyup"; import isClosingKeyup from "../sveltelib/closing-keyup";
import type { EventPredicateResult } from "../sveltelib/event-predicate"; import type { EventPredicateResult } from "../sveltelib/event-predicate";
import { documentKeyup, documentMouseDown } from "../sveltelib/event-store"; import { documentClick, documentKeyup } from "../sveltelib/event-store";
import type { PositioningCallback } from "../sveltelib/position/auto-update"; import type { PositioningCallback } from "../sveltelib/position/auto-update";
import autoUpdate from "../sveltelib/position/auto-update"; import autoUpdate from "../sveltelib/position/auto-update";
import type { PositionAlgorithm } from "../sveltelib/position/position-algorithm"; import type { PositionAlgorithm } from "../sveltelib/position/position-algorithm";
@ -105,7 +105,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
return; return;
} }
const closingClick = isClosingClick(documentMouseDown, { const closingClick = isClosingClick(documentClick, {
reference, reference,
floating, floating,
inside: closeOnInsideClick, inside: closeOnInsideClick,

View File

@ -34,7 +34,7 @@ function eventStore<T extends EventTarget, K extends keyof EventTargetToMap<T>>(
export default eventStore; export default eventStore;
const documentMouseDown = eventStore(document, "mousedown", MouseEvent); const documentClick = eventStore(document, "click", MouseEvent);
const documentKeyup = eventStore(document, "keyup", KeyboardEvent); const documentKeyup = eventStore(document, "keyup", KeyboardEvent);
export { documentKeyup, documentMouseDown }; export { documentClick, documentKeyup };