Skip to content

Commit 284838d

Browse files
committed
chore: use editor.options.element in handleClickOutside
1 parent e836d02 commit 284838d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/super-editor/src/extensions/custom-selection/custom-selection.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import { Decoration, DecorationSet } from 'prosemirror-view';
55
export const CustomSelectionPluginKey = new PluginKey('CustomSelection');
66

77
const handleClickOutside = (event, editor) => {
8-
const editorElem = document.querySelector('.editor-element');
8+
const editorElem = editor?.options?.element;
9+
if (!editorElem) return;
10+
911
const isInsideEditor = editorElem?.contains(event.target);
1012

1113
if (!isInsideEditor) {

0 commit comments

Comments
 (0)