fix closr upload modal event
This commit is contained in:
parent
0de5cf76f2
commit
62f6c26c49
|
@ -52,14 +52,7 @@ export const EditorFloatingMenu = (props: FloatingMenuProps) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div ref={props.ref} class={styles.editorFloatingMenu}>
|
<div ref={props.ref} class={styles.editorFloatingMenu}>
|
||||||
<button
|
<button type="button" onClick={() => setMenuOpen(!menuOpen())}>
|
||||||
type="button"
|
|
||||||
onClick={() => {
|
|
||||||
console.log('!!! selectedMenuItem:', selectedMenuItem())
|
|
||||||
|
|
||||||
setMenuOpen(!menuOpen())
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Icon name="editor-plus" />
|
<Icon name="editor-plus" />
|
||||||
</button>
|
</button>
|
||||||
<Show when={menuOpen()}>
|
<Show when={menuOpen()}>
|
||||||
|
@ -82,7 +75,7 @@ export const EditorFloatingMenu = (props: FloatingMenuProps) => {
|
||||||
</Show>
|
</Show>
|
||||||
</div>
|
</div>
|
||||||
<Modal variant="narrow" name="uploadImage" onClose={closeUploadModalHandler}>
|
<Modal variant="narrow" name="uploadImage" onClose={closeUploadModalHandler}>
|
||||||
<UploadModalContent editor={props.editor} />
|
<UploadModalContent closeCallback={() => setSelectedMenuItem(null)} editor={props.editor} />
|
||||||
</Modal>
|
</Modal>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|
|
@ -14,6 +14,7 @@ import { verifyImg } from '../../../utils/verifyImg'
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
editor: Editor
|
editor: Editor
|
||||||
|
closeCallback: () => void
|
||||||
}
|
}
|
||||||
|
|
||||||
export const UploadModalContent = (props: Props) => {
|
export const UploadModalContent = (props: Props) => {
|
||||||
|
@ -103,6 +104,7 @@ export const UploadModalContent = (props: Props) => {
|
||||||
showInput={true}
|
showInput={true}
|
||||||
onClose={() => {
|
onClose={() => {
|
||||||
hideModal()
|
hideModal()
|
||||||
|
props.closeCallback()
|
||||||
}}
|
}}
|
||||||
validate={(value) => verifyImg(value)}
|
validate={(value) => verifyImg(value)}
|
||||||
onSubmit={handleImageFormSubmit}
|
onSubmit={handleImageFormSubmit}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user