@mdxeditor/editor 0.14.1 → 0.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/MDXEditor.js CHANGED
@@ -61,9 +61,16 @@ const EditorRootElement = ({ children, className }) => {
61
61
  const editorRootElementRef = React__default.useRef(null);
62
62
  const setEditorRootElementRef = corePluginHooks.usePublisher("editorRootElementRef");
63
63
  React__default.useEffect(() => {
64
+ const popupContainer = document.createElement("div");
65
+ popupContainer.classList.add(styles.editorRoot);
66
+ document.body.appendChild(popupContainer);
67
+ editorRootElementRef.current = popupContainer;
64
68
  setEditorRootElementRef(editorRootElementRef);
69
+ return () => {
70
+ document.body.removeChild(popupContainer);
71
+ };
65
72
  }, [editorRootElementRef, setEditorRootElementRef]);
66
- return /* @__PURE__ */ React__default.createElement("div", { className: classNames(styles.editorRoot, styles.editorWrapper, className, "mdxeditor"), ref: editorRootElementRef }, children);
73
+ return /* @__PURE__ */ React__default.createElement("div", { className: classNames(styles.editorRoot, styles.editorWrapper, className, "mdxeditor") }, children);
67
74
  };
68
75
  const Methods = ({ mdxRef }) => {
69
76
  const realm = corePluginHooks.useRealmContext();
@@ -77,6 +77,7 @@ const DialogForm = ({ autocompleteSuggestions, onSubmitCallback, dialogInputPlac
77
77
  };
78
78
  const onSubmitEH = (e) => {
79
79
  e.preventDefault();
80
+ e.stopPropagation();
80
81
  onSubmitCallback(inputProps.value);
81
82
  };
82
83
  const dropdownIsVisible = isOpen && items.length > 0;
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "private": false,
10
10
  "sideEffects": false,
11
11
  "type": "module",
12
- "version": "0.14.1",
12
+ "version": "0.14.2",
13
13
  "description": "React component for rich text markdown editing",
14
14
  "scripts": {
15
15
  "build": "vite build",