diff --git a/src/MDXEditor.tsx b/src/MDXEditor.tsx index 5b2bd99c..b52fb778 100644 --- a/src/MDXEditor.tsx +++ b/src/MDXEditor.tsx @@ -172,13 +172,18 @@ const EditorRootElement: React.FC<{ children: React.ReactNode; className?: strin React.useEffect(() => { const popupContainer = document.createElement('div') popupContainer.classList.add(styles.editorRoot) + if (className) { + className.split(' ').forEach((c) => { + popupContainer.classList.add(c); + }); + } document.body.appendChild(popupContainer) editorRootElementRef.current = popupContainer setEditorRootElementRef(editorRootElementRef) return () => { document.body.removeChild(popupContainer) } - }, [editorRootElementRef, setEditorRootElementRef]) + }, [className, editorRootElementRef, setEditorRootElementRef]) return
{children}
}