diff --git a/app/src/displays/labels/labels.vue b/app/src/displays/labels/labels.vue index 37a4f3a6ec..60a0560565 100644 --- a/app/src/displays/labels/labels.vue +++ b/app/src/displays/labels/labels.vue @@ -81,17 +81,29 @@ export default defineComponent({ return items.map((item) => { const choice = (props.choices || []).find((choice) => choice.value === item); + let itemStringValue: string; + + if (typeof item === 'object') { + itemStringValue = JSON.stringify(item); + } else { + if (props.format) { + itemStringValue = formatTitle(item); + } else { + itemStringValue = item; + } + } + if (choice === undefined) { return { value: item, - text: props.format ? formatTitle(item) : item, + text: itemStringValue, foreground: props.defaultForeground, background: props.defaultBackground, }; } else { return { value: item, - text: choice.text || (props.format ? formatTitle(item) : item), + text: choice.text || itemStringValue, foreground: choice.foreground || props.defaultForeground, background: choice.background || props.defaultBackground, };