mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 03:48:13 +08:00
Merge pull request #9550 from wibetter/master
fix(amis): InputText 清空操作支持clearValueOnEmpty配置
This commit is contained in:
commit
60d7f4d942
@ -298,7 +298,12 @@ export default class TextControl extends React.PureComponent<
|
||||
}
|
||||
|
||||
async clearValue() {
|
||||
const {onChange, resetValue, dispatchEvent} = this.props;
|
||||
const {onChange, dispatchEvent, clearValueOnEmpty} = this.props;
|
||||
let resetValue = this.props.resetValue;
|
||||
|
||||
if (clearValueOnEmpty && resetValue === '') {
|
||||
resetValue = undefined;
|
||||
}
|
||||
|
||||
const clearEvent = await dispatchEvent(
|
||||
'clear',
|
||||
|
Loading…
Reference in New Issue
Block a user