From 1e18b3f26ca695970fa382d3ecc3030736bbb3e0 Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Wed, 20 Jan 2021 12:23:37 +0300 Subject: [PATCH] Fixed #858 - Autocomplete crashes when "field" property is a function --- src/components/autocomplete/AutoComplete.d.ts | 2 +- src/components/autocomplete/AutoComplete.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/autocomplete/AutoComplete.d.ts b/src/components/autocomplete/AutoComplete.d.ts index a2ffcf964..353c23743 100755 --- a/src/components/autocomplete/AutoComplete.d.ts +++ b/src/components/autocomplete/AutoComplete.d.ts @@ -3,7 +3,7 @@ import Vue, { VNode } from 'vue'; declare class AutoComplete extends Vue { modelValue?: any; suggestions?: any[]; - field?: string; + field?: string|function; scrollHeight?: string; dropdown?: boolean; dropdownMode?: string; diff --git a/src/components/autocomplete/AutoComplete.vue b/src/components/autocomplete/AutoComplete.vue index 51424d11c..0ed5167ee 100755 --- a/src/components/autocomplete/AutoComplete.vue +++ b/src/components/autocomplete/AutoComplete.vue @@ -46,7 +46,7 @@ export default { default: null }, field: { - type: String, + type: [String,Function], default: null }, scrollHeight: { @@ -457,7 +457,7 @@ export default { }, inputValue() { if (this.modelValue) { - if (this.field) { + if (this.field && typeof this.modelValue === 'object') { const resolvedFieldData = ObjectUtils.resolveFieldData(this.modelValue, this.field); return resolvedFieldData != null ? resolvedFieldData : this.modelValue; }