Skip to content

Commit

Permalink
Fix text node check
Browse files Browse the repository at this point in the history
  • Loading branch information
Mati365 committed Aug 22, 2024
1 parent c6985d2 commit 4386298
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ export default class BalloonPanelView extends View {
if ( !this._resizeObserver ) {
// If the target element is a text node, we need to check the parent element.
// It's because `ResizeObserver` accept only elements, not text nodes.
if ( targetElement instanceof Text ) {
if ( targetElement && targetElement.nodeType === Node.TEXT_NODE ) {
targetElement = targetElement.parentElement;
}

Expand Down

0 comments on commit 4386298

Please sign in to comment.