diff --git a/src/components/Dashboard/common/ObjectSelect.jsx b/src/components/Dashboard/common/ObjectSelect.jsx index 375ed4e..ef4f65d 100644 --- a/src/components/Dashboard/common/ObjectSelect.jsx +++ b/src/components/Dashboard/common/ObjectSelect.jsx @@ -56,6 +56,26 @@ const ObjectSelect = ({ // Normalize a value to an identity string so we can detect in-place _id updates const getValueIdentity = useCallback((val) => { if (val && typeof val === 'object') { + // Handle arrays + if (Array.isArray(val)) { + const ids = val + .map((item) => { + if (item && typeof item === 'object') { + if (item._id) return String(item._id) + if ( + item.value && + typeof item.value === 'object' && + item.value._id + ) + return String(item.value._id) + } + return null + }) + .filter(Boolean) + .sort() + return ids.length > 0 ? ids.join(',') : JSON.stringify(val) + } + // Handle single objects if (val._id) return String(val._id) if (val.value && typeof val.value === 'object' && val.value._id) return String(val.value._id)