From a5a193404a01a4a80cf917b3c9ea9a40b9e3a528 Mon Sep 17 00:00:00 2001 From: jojohoch <joachim.hoch@iqb.hu-berlin.de> Date: Tue, 19 Mar 2024 15:44:46 +0100 Subject: [PATCH] [player] Open marking bar with delay The delay is used to check whether a selection is still available after PointerUp, as this is often deleted in Firefox under Windows mobile --- .../text-group-element/text-group-element.component.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/projects/player/src/app/components/elements/text-group-element/text-group-element.component.ts b/projects/player/src/app/components/elements/text-group-element/text-group-element.component.ts index 71af08bd2..8244c8fc1 100644 --- a/projects/player/src/app/components/elements/text-group-element/text-group-element.component.ts +++ b/projects/player/src/app/components/elements/text-group-element/text-group-element.component.ts @@ -120,7 +120,13 @@ export class TextGroupElementComponent extends ElementGroupDirective implements } else if (this.selectedMode && this.selectedColor) { this.applyMarkingDataToText(this.selectedMode, this.selectedColor); } else if (!this.isMarkingBarOpen) { - this.openMarkingBar(textSelectionPosition); + // hack for windows mobile to prevent opening marking bar while selection is removed on FF + setTimeout(() => { + const selectionTest = window.getSelection(); + if (selectionTest && TextMarkingService.isSelectionValid(selectionTest) && selectionTest.rangeCount > 0) { + this.openMarkingBar(textSelectionPosition); + } + }, 100); } } } -- GitLab