2
0

🐛 (graph) Make the text bubble selectable without moving group

This commit is contained in:
Baptiste Arnaud
2022-11-24 08:37:08 +01:00
parent 9d69470630
commit 0593d2ead8

View File

@ -1,4 +1,9 @@
import { Flex, Stack, useOutsideClick } from '@chakra-ui/react'
import {
Flex,
Stack,
useEventListener,
useOutsideClick,
} from '@chakra-ui/react'
import React, { useEffect, useRef, useState } from 'react'
import {
Plate,
@ -76,9 +81,13 @@ const TextBubbleEditorContent = ({
}
}
const handleMouseDown = (e: React.MouseEvent) => {
e.stopPropagation()
}
useEventListener(
'pointerdown',
(e) => {
e.stopPropagation()
},
textEditorRef.current
)
const handleVariableSelected = (variable?: Variable) => {
setIsVariableDropdownOpen(false)
@ -100,7 +109,6 @@ const TextBubbleEditorContent = ({
borderWidth="2px"
borderColor="blue.400"
rounded="md"
onMouseDown={handleMouseDown}
pos="relative"
spacing={0}
cursor="text"