This code
| exportfunctionisDOM(node: any): node is HTMLElement|SVGElement{ |
| // https://developer.mozilla.org/en-US/docs/Web/API/Element |
| // Since XULElement is also subclass of Element, we only need HTMLElement and SVGElement |
| returnnodeinstanceofHTMLElement||nodeinstanceofSVGElement; |
| } |
Fails when node is not inside the current window. The main use case is using one screen for presentation and another screen for information that the presenter see.
an idea of a fix:
constnodeWindow=node?.ownerDocument?.defaultView;returnnodeinstanceofnodeWindow.HTMLElement||nodeinstanceofnodeWindow.SVGElement;
The issue is that the above code doesn't really work because you need to know if node is an Element first before getting the window, so we'll need a better idea for a fix.
a fix that I feel like is a hack:
return "nodeType" in node && node === Node.ELEMENT_NODE && "tagName" in node;
I don't know if this is good enough, but it works, fixes the bug.
same thing also happens here
| if(elementinstanceofElement){ |
This code
util/src/Dom/findDOMNode.ts
Lines 3 to 7 in 2880228
Fails when node is not inside the current window. The main use case is using one screen for presentation and another screen for information that the presenter see.
an idea of a fix:
The issue is that the above code doesn't really work because you need to know if node is an Element first before getting the window, so we'll need a better idea for a fix.
a fix that I feel like is a hack:
I don't know if this is good enough, but it works, fixes the bug.
same thing also happens here
util/src/Dom/isVisible.ts
Line 6 in 2880228