Skip to content

Commit

Permalink
Merge pull request #1803 from XiaoMi/hotfix/#1802
Browse files Browse the repository at this point in the history
Hotfix/#1802
  • Loading branch information
solarjoker authored Jun 24, 2021
2 parents fd82be2 + 7413d63 commit 4a0ec34
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
- 修复 `Slider` 组件 max、min 受控问题,Modal 中不能拖拽 [#1783](https://github.com/XiaoMi/hiui/issues/1783)
- 新增 `Slider` 组件 showRangeLabel 属性设置是否显示范围值 [#1783](https://github.com/XiaoMi/hiui/issues/1783)
- 修复 `DataePicker` 组件 yearrange、monthrange 无法通过 min、max 限制时间区间问题 [#1780](https://github.com/XiaoMi/hiui/issues/1780)
- 修复 `Form` 组件值校验问题 [#1782](https://github.com/XiaoMi/hiui/issues/1782)
# 3.6.1
- 修复部分组件 'regeneratorRuntime is not defined' 问题 [#1719](https://github.com/XiaoMi/hiui/issues/1719)
- 修复 `Slider` max 和min 受控问题 [#1703](https://github.com/XiaoMi/hiui/issues/1703)
Expand Down
7 changes: 5 additions & 2 deletions components/form/Item.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@ const FormItem = (props) => {
}
return true
}
const rules = getRules()
const rules = getRules().map((item) => {
item.type = item.type || 'any'
return item
})

const validator = new AsyncValidator({
[field]: rules
Expand Down Expand Up @@ -289,7 +292,7 @@ const FormItem = (props) => {
return item.field === _field
})
if (_field && !isExist) {
_value = initialValues && initialValues[field] ? initialValues[_field] : _value
_value = initialValues && typeof initialValues[field] !== 'undefined' ? initialValues[_field] : _value
if (_type === 'list' && listItemValue) {
_value = Object.keys(listItemValue).includes(name) ? listItemValue[name] : listItemValue
}
Expand Down
2 changes: 1 addition & 1 deletion docs/demo/form/section-synthetic.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class Demo extends React.Component {
</Col>
</Row>
<FormItem label='Radio' field="radio">
<FormItem label='Radio' field="radio" required>
<Radio.Group
data={radiolist}
onChange={(data) => console.log("radio data",data)}
Expand Down

0 comments on commit 4a0ec34

Please sign in to comment.