2
0

fix(editor): ️ Improve block focus

This commit is contained in:
Baptiste Arnaud
2022-03-29 10:23:45 +02:00
parent 1f992c6779
commit 261cd9a5c7
4 changed files with 22 additions and 3 deletions

View File

@ -45,8 +45,13 @@ export const StepNode = ({
onMouseDown?: (stepNodePosition: NodePosition, step: DraggableStep) => void
}) => {
const { query } = useRouter()
const { setConnectingIds, connectingIds, openedStepId, setOpenedStepId } =
useGraph()
const {
setConnectingIds,
connectingIds,
openedStepId,
setOpenedStepId,
setFocusedBlockId,
} = useGraph()
const { updateStep } = useTypebot()
const [isConnecting, setIsConnecting] = useState(false)
const [isPopoverOpened, setIsPopoverOpened] = useState(
@ -113,6 +118,7 @@ export const StepNode = ({
}
const handleClick = (e: React.MouseEvent) => {
setFocusedBlockId(step.blockId)
e.stopPropagation()
if (isTextBubbleStep(step)) setIsEditing(true)
setOpenedStepId(step.id)