Skip to content

Commit

Permalink
fix: added trim for passed className (#336)
Browse files Browse the repository at this point in the history
  • Loading branch information
Prominence authored Jan 29, 2024
1 parent 6fbe251 commit 6619220
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions src/MDXEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,12 @@ const EditorRootElement: React.FC<{ children: React.ReactNode; className?: strin
popupContainer.classList.add(styles.editorRoot)
popupContainer.classList.add(styles.popupContainer)
if (className) {
className.split(' ').forEach((c) => {
popupContainer.classList.add(c)
})
className
.trim()
.split(' ')
.forEach((c) => {
popupContainer.classList.add(c)
})
}
document.body.appendChild(popupContainer)
editorRootElementRef.current = popupContainer
Expand Down

0 comments on commit 6619220

Please sign in to comment.