From d8064af308747b60ee7de8daa5be994b740fdc92 Mon Sep 17 00:00:00 2001 From: hlomzik Date: Fri, 8 Nov 2024 18:51:17 +0000 Subject: [PATCH] fix: LEAP-1647: Fix comments when user uses OCR textarea The problem is that OCR textarea (displayMode=region-list) doesn't render any element in annotation, only in region list. So DOMWatcher failed trying to locate the tag. --- .../src/components/InteractiveOverlays/watchers/DOMWatcher.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/libs/editor/src/components/InteractiveOverlays/watchers/DOMWatcher.js b/web/libs/editor/src/components/InteractiveOverlays/watchers/DOMWatcher.js index 0a2c92ca9127..5e1ec4704c66 100644 --- a/web/libs/editor/src/components/InteractiveOverlays/watchers/DOMWatcher.js +++ b/web/libs/editor/src/components/InteractiveOverlays/watchers/DOMWatcher.js @@ -12,6 +12,8 @@ export class DOMWatcher { } handleUpdate() { + if (!this.element) return; + this.observer = new MutationObserver(this.onUpdate); this.observer.observe(this.element, { attributes: true });