From b8d41a6e9b427a6614a42f36cb8ea596a71c34ac Mon Sep 17 00:00:00 2001 From: Johannes <72809645+jobenjada@users.noreply.github.com> Date: Mon, 17 Nov 2025 01:36:13 -0800 Subject: [PATCH] perf: optimize survey editor drag and drop performance (#6823) --- .../editor/components/question-card.tsx | 2 +- .../editor/components/questions-droppable.tsx | 5 +- .../editor/components/questions-view.tsx | 62 ++++++++++++++++++- 3 files changed, 62 insertions(+), 7 deletions(-) diff --git a/apps/web/modules/survey/editor/components/question-card.tsx b/apps/web/modules/survey/editor/components/question-card.tsx index 95839eafec..82a7d66e11 100644 --- a/apps/web/modules/survey/editor/components/question-card.tsx +++ b/apps/web/modules/survey/editor/components/question-card.tsx @@ -195,7 +195,7 @@ export const QuestionCard = ({ {...attributes} className={cn( open ? "bg-slate-700" : "bg-slate-400", - "top-0 w-10 rounded-l-lg p-2 text-center text-sm text-white hover:cursor-grab hover:bg-slate-600", + "top-0 w-10 rounded-l-lg p-2 text-center text-sm text-white hover:cursor-grab", isInvalid && "bg-red-400 hover:bg-red-600", "flex flex-col items-center justify-between" )}> diff --git a/apps/web/modules/survey/editor/components/questions-droppable.tsx b/apps/web/modules/survey/editor/components/questions-droppable.tsx index bef20389e1..7ef664d2b0 100644 --- a/apps/web/modules/survey/editor/components/questions-droppable.tsx +++ b/apps/web/modules/survey/editor/components/questions-droppable.tsx @@ -1,5 +1,4 @@ import { SortableContext, verticalListSortingStrategy } from "@dnd-kit/sortable"; -import { useAutoAnimate } from "@formkit/auto-animate/react"; import { Project } from "@prisma/client"; import { TSurvey, TSurveyQuestionId } from "@formbricks/types/surveys/types"; import { TUserLocale } from "@formbricks/types/user"; @@ -48,10 +47,8 @@ export const QuestionsDroppable = ({ isStorageConfigured = true, isExternalUrlsAllowed, }: QuestionsDraggableProps) => { - const [parent] = useAutoAnimate(); - return ( -