Skip to content

Commit

Permalink
fix(form-item): feedback may hide and show again, closes #5583
Browse files Browse the repository at this point in the history
  • Loading branch information
07akioni committed Jan 23, 2024
1 parent efed8c0 commit a604c4b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- Fix `n-scrollbar`'s typo on `aria-hidden` attribute.
- `n-drawer` adds `borderRadius` attribute
- Fix overflow issue with `n-menu` `root-indent` `indent`, closes (#5616)
- Fix `n-form-item`'s feedback may hide and show again, closes [#5583](https://github.com/tusen-ai/naive-ui/issues/5583).

### Features

Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
- 修复 `n-tree``override-default-node-click-behavior` 属性可能覆盖掉默认展开按钮和选中按钮的行为
- Fix `n-scrollbar`'s typo on `aria-hidden` attribute.
- `n-drawer` 新增 `borderRadius` 属性
- 修复 `n-menu` `root-indent` `indent` 下内容溢出的问题,关闭(#5616)
- 修复 `n-menu` `root-indent` `indent` 下内容溢出的问题,关闭 #5616
- 修复 `n-form-item` 校验结果可能会闪烁的问题,关闭 [#5583](https://github.com/tusen-ai/naive-ui/issues/5583)

### Features

Expand Down
6 changes: 5 additions & 1 deletion src/form/src/FormItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,11 @@ export default defineComponent({
}
}

if (!validationResult.errors && !validationResult.warnings) {
if (
activeErrorRules.length + activeWarningRules.length > 0 &&
!validationResult.errors &&
!validationResult.warnings
) {
restoreValidation()
}

Expand Down

0 comments on commit a604c4b

Please sign in to comment.