This commit is contained in:
2026-04-03 16:19:49 +05:30
parent 63b31f0fc5
commit 7edf3e75da

View File

@@ -245,10 +245,22 @@ function FieldRenderer({ params, field, fieldKey, config, onNavigate, navigate,
} }
if (field.type === 'array' && Array.isArray(value)) { if (field.type === 'array' && Array.isArray(value)) {
if (field.displayField) { const displayList = field.displayField ?
return value.map((item) => (typeof item === 'object' ? item[field.displayField!] : item)).filter(Boolean).join(', '); value.map((item) => (typeof item === 'object' ? item[field.displayField!] : item)).filter(Boolean).join(', ') :
} `${value.length} items`;
return `${value.length} items`;
const tooltipTitle = value.map((item) => {
if (typeof item !== 'object') return String(item);
return item.name || item.title || item.label || item[field.displayField!] || JSON.stringify(item);
}).join(', ');
return (
<Tooltip title={tooltipTitle} arrow placement="top">
<Box component="span" sx={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', display: 'block' }}>
{displayList}
</Box>
</Tooltip>
);
} }
if (field.type === 'object' && value) { if (field.type === 'object' && value) {