From 56d9d31d4ac9f2913bec14a2e3c4472fcfd90a7b Mon Sep 17 00:00:00 2001 From: bobzel Date: Mon, 5 Oct 2020 14:34:16 -0400 Subject: fixed formatted texst box select on load when pdf is full screen and the same pdf is in inactive tab behind it. --- src/client/views/nodes/formattedText/FormattedTextBox.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx index b0199b35f..ef39e6a90 100644 --- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx +++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx @@ -1124,11 +1124,11 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<(FieldViewProp } private isActiveTab(el: Element | null | undefined) { - do { - if (el?.className.includes("lm_active")) return true; - el = el?.parentNode as any; - } while (el !== document.body); - return false; + while (el && el !== document.body) { + if (getComputedStyle(el).display === "none") return false; + el = el.parentNode as any; + } + return true; } private setupEditor(config: any, fieldKey: string) { -- cgit v1.2.3-70-g09d2