diff --git a/ts/components/WithFloating.svelte b/ts/components/WithFloating.svelte index 462c08b9e..50773fb83 100644 --- a/ts/components/WithFloating.svelte +++ b/ts/components/WithFloating.svelte @@ -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 isClosingKeyup from "../sveltelib/closing-keyup"; 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 type { PositioningCallback } 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; } - const closingClick = isClosingClick(documentMouseDown, { + const closingClick = isClosingClick(documentClick, { reference, floating, inside: closeOnInsideClick, diff --git a/ts/components/WithOverlay.svelte b/ts/components/WithOverlay.svelte index b06d2ce34..ec5c50b9c 100644 --- a/ts/components/WithOverlay.svelte +++ b/ts/components/WithOverlay.svelte @@ -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 isClosingKeyup from "../sveltelib/closing-keyup"; 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 autoUpdate from "../sveltelib/position/auto-update"; 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; } - const closingClick = isClosingClick(documentMouseDown, { + const closingClick = isClosingClick(documentClick, { reference, floating, inside: closeOnInsideClick, diff --git a/ts/sveltelib/event-store.ts b/ts/sveltelib/event-store.ts index 2b7f3ef5a..0930919f4 100644 --- a/ts/sveltelib/event-store.ts +++ b/ts/sveltelib/event-store.ts @@ -34,7 +34,7 @@ function eventStore>( export default eventStore; -const documentMouseDown = eventStore(document, "mousedown", MouseEvent); +const documentClick = eventStore(document, "click", MouseEvent); const documentKeyup = eventStore(document, "keyup", KeyboardEvent); -export { documentKeyup, documentMouseDown }; +export { documentClick, documentKeyup };