Fixed #858 - Autocomplete crashes when "field" property is a function
parent
59d04e8344
commit
1e18b3f26c
|
@ -3,7 +3,7 @@ import Vue, { VNode } from 'vue';
|
||||||
declare class AutoComplete extends Vue {
|
declare class AutoComplete extends Vue {
|
||||||
modelValue?: any;
|
modelValue?: any;
|
||||||
suggestions?: any[];
|
suggestions?: any[];
|
||||||
field?: string;
|
field?: string|function;
|
||||||
scrollHeight?: string;
|
scrollHeight?: string;
|
||||||
dropdown?: boolean;
|
dropdown?: boolean;
|
||||||
dropdownMode?: string;
|
dropdownMode?: string;
|
||||||
|
|
|
@ -46,7 +46,7 @@ export default {
|
||||||
default: null
|
default: null
|
||||||
},
|
},
|
||||||
field: {
|
field: {
|
||||||
type: String,
|
type: [String,Function],
|
||||||
default: null
|
default: null
|
||||||
},
|
},
|
||||||
scrollHeight: {
|
scrollHeight: {
|
||||||
|
@ -457,7 +457,7 @@ export default {
|
||||||
},
|
},
|
||||||
inputValue() {
|
inputValue() {
|
||||||
if (this.modelValue) {
|
if (this.modelValue) {
|
||||||
if (this.field) {
|
if (this.field && typeof this.modelValue === 'object') {
|
||||||
const resolvedFieldData = ObjectUtils.resolveFieldData(this.modelValue, this.field);
|
const resolvedFieldData = ObjectUtils.resolveFieldData(this.modelValue, this.field);
|
||||||
return resolvedFieldData != null ? resolvedFieldData : this.modelValue;
|
return resolvedFieldData != null ? resolvedFieldData : this.modelValue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue