Skip to content

Commit

Permalink
Fix #1392: AutoComplete shows "[object Object]" (#2766)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Aug 31, 2022
1 parent a9ff149 commit 9ff9ce8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/lib/autocomplete/AutoComplete.js
Expand Up @@ -131,7 +131,9 @@ export const AutoComplete = React.memo(

const formatValue = (value) => {
if (value) {
if (props.selectedItemTemplate && (props.multiple ? isSelected(value) : findOptionIndex(value) > -1)) {
if (typeof value === 'string') {
return value;
} else if (props.selectedItemTemplate) {
const resolvedFieldData = ObjectUtils.getJSXElement(props.selectedItemTemplate, value);
return resolvedFieldData ? resolvedFieldData : value;
} else if (props.field) {
Expand Down

0 comments on commit 9ff9ce8

Please sign in to comment.