From 5c8ce178e5f6905a7f16d3ea829f323a285e3e60 Mon Sep 17 00:00:00 2001 From: Philipinho <16838612+Philipinho@users.noreply.github.com> Date: Tue, 21 Apr 2026 12:04:36 +0100 Subject: [PATCH] fix(base): stabilize choices reference so Add option row does not flicker --- .../features/base/components/property/property-options.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/client/src/features/base/components/property/property-options.tsx b/apps/client/src/features/base/components/property/property-options.tsx index 37b6f962..e59fb6ce 100644 --- a/apps/client/src/features/base/components/property/property-options.tsx +++ b/apps/client/src/features/base/components/property/property-options.tsx @@ -1,4 +1,4 @@ -import { useCallback } from "react"; +import { useCallback, useMemo } from "react"; import { Stack, NumberInput, Select, Switch, Text } from "@mantine/core"; import { IBaseProperty, @@ -88,7 +88,7 @@ function SelectOptions({ hideButtons?: boolean; }) { const options = property.typeOptions as SelectTypeOptions | undefined; - const choices = options?.choices ?? []; + const choices = useMemo(() => options?.choices ?? [], [options?.choices]); const handleSave = useCallback( (newChoices: Choice[]) => { @@ -127,7 +127,7 @@ function StatusOptions({ hideButtons?: boolean; }) { const options = property.typeOptions as SelectTypeOptions | undefined; - const choices = options?.choices ?? []; + const choices = useMemo(() => options?.choices ?? [], [options?.choices]); const handleSave = useCallback( (newChoices: Choice[]) => {