mirror of
https://github.com/codex-team/editor.js
synced 2024-06-10 18:03:25 +02:00
* Release 2.19.2 (#1597) Save 2.19.2 changes * 1317 The selection node sometimes ends up being the ShadowRoot which does not have the closest method. In case it is the shadowroot - I believe we can assume the selection is not at the editor zone Co-authored-by: Peter Savchenko <specc.dev@gmail.com> Co-authored-by: George Berezhnoy <gohabereg@users.noreply.github.com>
This commit is contained in:
parent
aa5a3d05f3
commit
d5aaa56ca0
|
@ -125,7 +125,7 @@ export default class SelectionUtils {
|
|||
|
||||
let editorZone = null;
|
||||
|
||||
if (selectedNode) {
|
||||
if (selectedNode && selectedNode instanceof Element) {
|
||||
editorZone = selectedNode.closest(`.${SelectionUtils.CSS.editorZone}`);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue