From 938bea5342074c6591c450d4a47ef9de2d3a72f4 Mon Sep 17 00:00:00 2001 From: Tom Butcher Date: Mon, 20 Jul 2026 02:07:19 +0100 Subject: [PATCH] Refactor ObjectSelect component to improve ID comparison and ensure case-insensitive matching. Update value and key properties to use lowercase string representation of object IDs for consistent handling. --- src/components/Dashboard/common/ObjectSelect.jsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/Dashboard/common/ObjectSelect.jsx b/src/components/Dashboard/common/ObjectSelect.jsx index 92db19e..753704a 100644 --- a/src/components/Dashboard/common/ObjectSelect.jsx +++ b/src/components/Dashboard/common/ObjectSelect.jsx @@ -217,7 +217,14 @@ const ObjectSelect = ({ if (pIdx >= properties.length) { return data.map((object) => { setObjectList((prev) => { - if (prev.some((p) => p._id === object._id)) return prev + if ( + prev.some( + (p) => + p._id.toString().toLowerCase() === + object._id.toString().toLowerCase() + ) + ) + return prev return [...prev, object] }) return { @@ -235,8 +242,8 @@ const ObjectSelect = ({ /> ), - value: object._id, - key: object._id, + value: object._id.toString().toLowerCase(), + key: object._id.toString().toLowerCase(), isLeaf: true, parentKeys, filterPath