🐛 (graph) Make the text bubble selectable without moving group
This commit is contained in:
@@ -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 React, { useEffect, useRef, useState } from 'react'
|
||||||
import {
|
import {
|
||||||
Plate,
|
Plate,
|
||||||
@@ -76,9 +81,13 @@ const TextBubbleEditorContent = ({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleMouseDown = (e: React.MouseEvent) => {
|
useEventListener(
|
||||||
e.stopPropagation()
|
'pointerdown',
|
||||||
}
|
(e) => {
|
||||||
|
e.stopPropagation()
|
||||||
|
},
|
||||||
|
textEditorRef.current
|
||||||
|
)
|
||||||
|
|
||||||
const handleVariableSelected = (variable?: Variable) => {
|
const handleVariableSelected = (variable?: Variable) => {
|
||||||
setIsVariableDropdownOpen(false)
|
setIsVariableDropdownOpen(false)
|
||||||
@@ -100,7 +109,6 @@ const TextBubbleEditorContent = ({
|
|||||||
borderWidth="2px"
|
borderWidth="2px"
|
||||||
borderColor="blue.400"
|
borderColor="blue.400"
|
||||||
rounded="md"
|
rounded="md"
|
||||||
onMouseDown={handleMouseDown}
|
|
||||||
pos="relative"
|
pos="relative"
|
||||||
spacing={0}
|
spacing={0}
|
||||||
cursor="text"
|
cursor="text"
|
||||||
|
|||||||
Reference in New Issue
Block a user