From 5ceaa961a1eade131e29b3563e99d2db9bedba78 Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Wed, 29 Jan 2025 20:08:22 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20(builder)=20prevent=20auto=20ope?= =?UTF-8?q?ning=20block=20settings=20for=20buttons=20types?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/builder/src/features/graph/components/Graph.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/builder/src/features/graph/components/Graph.tsx b/apps/builder/src/features/graph/components/Graph.tsx index 7067a351c..1d2bd7220 100644 --- a/apps/builder/src/features/graph/components/Graph.tsx +++ b/apps/builder/src/features/graph/components/Graph.tsx @@ -4,6 +4,7 @@ import { useTypebot } from "@/features/editor/providers/TypebotProvider"; import { Fade, Flex, type FlexProps, useEventListener } from "@chakra-ui/react"; import { createId } from "@paralleldrive/cuid2"; import type { BlockV6 } from "@typebot.io/blocks-core/schemas/schema"; +import { InputBlockType } from "@typebot.io/blocks-inputs/constants"; import { GraphNavigation } from "@typebot.io/prisma/enum"; import type { EdgeWithTotalUsers, @@ -161,7 +162,13 @@ export const Graph = ({ }); setDraggedBlock(undefined); setDraggedBlockType(undefined); - if (newBlockId) setOpenedBlockId(newBlockId); + if ( + newBlockId && + draggedBlockType !== InputBlockType.CHOICE && + draggedBlockType !== InputBlockType.PICTURE_CHOICE + ) { + setOpenedBlockId(newBlockId); + } }; const handleCaptureMouseDown = (e: MouseEvent) => {