@mdxeditor/editor 0.14.0 → 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();
@@ -55,10 +55,6 @@ const DialogForm = ({ autocompleteSuggestions, onSubmitCallback, dialogInputPlac
55
55
  return item ?? "";
56
56
  }
57
57
  });
58
- const onSubmitEH = (e) => {
59
- e.preventDefault();
60
- onSubmitCallback(selectedItem || "");
61
- };
62
58
  const onKeyDownEH = React__default.useCallback(
63
59
  (e) => {
64
60
  var _a;
@@ -79,6 +75,11 @@ const DialogForm = ({ autocompleteSuggestions, onSubmitCallback, dialogInputPlac
79
75
  downshiftInputProps.onKeyDown(e);
80
76
  }
81
77
  };
78
+ const onSubmitEH = (e) => {
79
+ e.preventDefault();
80
+ e.stopPropagation();
81
+ onSubmitCallback(inputProps.value);
82
+ };
82
83
  const dropdownIsVisible = isOpen && items.length > 0;
83
84
  return /* @__PURE__ */ React__default.createElement("form", { onSubmit: onSubmitEH, className: classNames(styles.linkDialogEditForm) }, /* @__PURE__ */ React__default.createElement("div", { className: styles.linkDialogInputContainer }, /* @__PURE__ */ React__default.createElement("div", { "data-visible-dropdown": dropdownIsVisible, className: styles.linkDialogInputWrapper }, /* @__PURE__ */ React__default.createElement(
84
85
  "input",
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "private": false,
10
10
  "sideEffects": false,
11
11
  "type": "module",
12
- "version": "0.14.0",
12
+ "version": "0.14.2",
13
13
  "description": "React component for rich text markdown editing",
14
14
  "scripts": {
15
15
  "build": "vite build",