From ed8a368dbce7396e1bf1dd89f90ae542d076936f Mon Sep 17 00:00:00 2001 From: Wugaoliang Date: Mon, 2 Nov 2020 15:05:59 +0800 Subject: [PATCH] fix: #1259 --- CHANGELOG.md | 1 + components/form/Item.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e11b0c710..f12eb98f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 2.15.1 - 修复 `` type 不受控问题 [#1251](https://github.com/XiaoMi/hiui/issues/1251) +- 修复 `
` 使用 Upload 组件 onChange 方法 return false 无效 [#1259](https://github.com/XiaoMi/hiui/issues/1259) ## 2.15.0 diff --git a/components/form/Item.js b/components/form/Item.js index a6eaf2c70..5a85fbffd 100644 --- a/components/form/Item.js +++ b/components/form/Item.js @@ -179,10 +179,11 @@ class FormItem extends Component { ? children : React.cloneElement(children, { onChange: (...args) => { - children.props.onChange && children.props.onChange(...args) + const changeVal = children.props.onChange && children.props.onChange(...args) setTimeout(() => { this.handleFieldChange() }) + return changeVal }, onBlur: (...args) => { children.props.onBlur && children.props.onBlur(...args)