forked from p96170835/amis
修复text autoComplete 中选中后显示value而不是label的问题
This commit is contained in:
parent
fec869552b
commit
8edecde1ed
|
@ -340,9 +340,11 @@ export default class TextControl extends React.PureComponent<TextProps, TextStat
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
if (autoComplete && formItem) {
|
if (autoComplete && formItem) {
|
||||||
|
const length = formItem.selectedOptions.length;
|
||||||
|
const lastSelectLabel = length ? formItem.selectedOptions[length - 1].label : '';
|
||||||
formItem.loadOptions(autoComplete, {
|
formItem.loadOptions(autoComplete, {
|
||||||
...data,
|
...data,
|
||||||
term: this.state.inputValue || formItem.lastSelectValue
|
term: this.state.inputValue || lastSelectLabel
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue