Skip to content

Commit

Permalink
Fix list editor summary formatter, v2
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoshino committed Jul 3, 2024
1 parent bb137a4 commit 482f084
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,15 @@
*/
const formatSummary = (item, index, summaryTemplate) => {
if (!summaryTemplate) {
if (typeof item === 'string') {
return item;
}
return (
item.title ||
item.name ||
// Use the first string-type field value, if available
(typeof item === 'string'
? item
: Object.values(item).find((value) => typeof value === 'string' && !!value)) ||
Object.values(item).find((value) => typeof value === 'string' && !!value) ||
''
);
}
Expand Down

0 comments on commit 482f084

Please sign in to comment.