Skip to content

Commit

Permalink
Refine list component option labeling strategy.
Browse files Browse the repository at this point in the history
  • Loading branch information
kitschpatrol committed May 20, 2024
1 parent 3a6ad91 commit 2f93a40
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/control/List.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@
? options
: isObjectStyleListOptions(options)
? options
: options.map((value) => ({ value, text: JSON.stringify(value) }));
: options.map((value) => ({
value,
text: typeof value === 'object' ? JSON.stringify(value) : String(value)
}));
}
function setValue() {
Expand Down

0 comments on commit 2f93a40

Please sign in to comment.