mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 02:58:05 +08:00
fix:input clear时补充change事件 (#9442)
This commit is contained in:
parent
a73b8a7685
commit
006413c887
@ -296,12 +296,21 @@ export default class TextControl extends React.PureComponent<
|
||||
async clearValue() {
|
||||
const {onChange, resetValue, dispatchEvent} = this.props;
|
||||
|
||||
const rendererEvent = await dispatchEvent(
|
||||
const clearEvent = await dispatchEvent(
|
||||
'clear',
|
||||
resolveEventData(this.props, {value: resetValue})
|
||||
);
|
||||
|
||||
if (rendererEvent?.prevented) {
|
||||
if (clearEvent?.prevented) {
|
||||
return;
|
||||
}
|
||||
|
||||
const changeEvent = await dispatchEvent(
|
||||
'change',
|
||||
resolveEventData(this.props, {resetValue})
|
||||
);
|
||||
|
||||
if (changeEvent?.prevented) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user