Bugfix: node is null

This commit is contained in:
the-djmaze 2023-05-08 10:36:23 +02:00
parent 7b70117155
commit eab3beaf2a

View file

@ -2669,7 +2669,7 @@ class Squire
newPath = (anchor && focus) ? (node ? getPath(focus, this._root) : '(selection)') : '';
if (this._path !== newPath) {
this._path = newPath;
this.fireEvent('pathChange', { path: newPath, element: isElement(node) ? node : node.parentElement });
this.fireEvent('pathChange', { path: newPath, element: (!node || isElement(node)) ? node : node.parentElement });
}
}
this.fireEvent(range.collapsed ? 'cursor' : 'select', {