We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4aa2a30 commit 51f2e95Copy full SHA for 51f2e95
1 file changed
src/widget.ts
@@ -72,7 +72,12 @@ class ReactWidgetImpl<
72
if (this.root === undefined || this.containerElement === undefined) {
73
this.containerElement = document.createElement('div');
74
this.root = ReactDom.createRoot(this.containerElement);
75
- this.connectionObserver?.observe?.(this.parentDomNode ?? this.containerElement);
+ let domToObserve = this.containerElement;
76
+ // sometimes parent node isTiddlyWikiFakeDom, we can't use it.
77
+ if (this.parentDomNode instanceof Node) {
78
+ domToObserve = this.parentDomNode as HTMLDivElement;
79
+ }
80
+ this.connectionObserver?.observe?.(domToObserve);
81
}
82
this.domNodes.push(this.containerElement);
83
nextSibling === null ? parent.append(this.containerElement) : nextSibling.before(this.containerElement);
0 commit comments