🐛 (editor) Fix single block duplication

This commit is contained in:
Baptiste Arnaud
2024-01-25 12:53:33 +01:00
parent 47af9a9a59
commit b668ac15f1
7 changed files with 153 additions and 113 deletions

View File

@@ -17,6 +17,7 @@ import {
} from '@chakra-ui/react'
export interface ContextMenuProps<T extends HTMLElement> {
onOpen?: () => void
renderMenu: () => JSX.Element | null
children: (
ref: MutableRefObject<T | null>,
@@ -61,6 +62,7 @@ export function ContextMenu<T extends HTMLElement = HTMLElement>(
if (e.currentTarget === targetRef.current) {
e.preventDefault()
e.stopPropagation()
props.onOpen?.()
setIsOpened(true)
setPosition([e.pageX, e.pageY])
} else {