Editor clear state after horizontal rule set (#130)

* Editor clear state after horizontal rule set

* remove debug code
This commit is contained in:
Ilya Y 2023-07-18 14:23:05 +03:00 committed by GitHub
parent 1fa502c6f1
commit ce0435ae81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 101 additions and 2960 deletions

3055
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -52,10 +52,12 @@ export const EditorFloatingMenu = (props: FloatingMenuProps) => {
} }
case 'horizontal-rule': { case 'horizontal-rule': {
props.editor.chain().focus().setHorizontalRule().run() props.editor.chain().focus().setHorizontalRule().run()
setSelectedMenuItem()
return return
} }
} }
}) })
const closeUploadModalHandler = () => { const closeUploadModalHandler = () => {
setSelectedMenuItem() setSelectedMenuItem()
setMenuOpen(false) setMenuOpen(false)
@ -89,9 +91,7 @@ export const EditorFloatingMenu = (props: FloatingMenuProps) => {
<button <button
ref={(el) => (plusButtonRef.current = el)} ref={(el) => (plusButtonRef.current = el)}
type="button" type="button"
onClick={() => { onClick={() => setMenuOpen(!menuOpen())}
setMenuOpen(!menuOpen())
}}
> >
<Icon name="editor-plus" /> <Icon name="editor-plus" />
</button> </button>