From a24bbd3e4d2fa9845d06649c275e1017931d9dc1 Mon Sep 17 00:00:00 2001 From: anamontiaga Date: Thu, 14 Dec 2023 15:46:33 +0100 Subject: [PATCH] set index with index of --- .../scenario/grid-setup/features/add/add-modal/component.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/layout/project/sidebar/scenario/grid-setup/features/add/add-modal/component.tsx b/app/layout/project/sidebar/scenario/grid-setup/features/add/add-modal/component.tsx index 541c22f825..a3c593bcec 100644 --- a/app/layout/project/sidebar/scenario/grid-setup/features/add/add-modal/component.tsx +++ b/app/layout/project/sidebar/scenario/grid-setup/features/add/add-modal/component.tsx @@ -60,7 +60,8 @@ export const ScenariosFeaturesAdd = (): JSX.Element => { const { value, onChange } = input; const selected = [...value]; - const selectedIndex = selected.findIndex((f) => f === id); + const item = selected.find((f) => f === id); + const selectedIndex = selected.indexOf(item); if (selectedIndex !== -1) { selected.splice(selectedIndex, 1);