Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(form-item): validation input or change and blur, The animation triggers twice #5585

Closed
wants to merge 9 commits into from
Closed

fix(form-item): validation input or change and blur, The animation triggers twice #5585

wants to merge 9 commits into from

Conversation

XueHua-s
Copy link
Contributor

@XueHua-s XueHua-s commented Jan 11, 2024

close #5583

Copy link

vercel bot commented Jan 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
naive-ui ❌ Failed (Inspect) Jan 12, 2024 1:27am

@XueHua-s
Copy link
Contributor Author

n-form表单错误信息动画优化
当form表单的rule设置了多个trigger,比如trigger: ['input', 'blur'],此时input会触发错误信息,blur也会触发错误信息,错误出现会有动画效果,导致页面错误信息展示再闪一次出现。
1、打开官网示例:https://www.naiveui.com/zh-CN/os-theme/components/form
2、在年龄输入框中输入任意值并点击其他地方让输入框失去焦点
3、再次点击输入框,将内容删除,此时会出现必填的校验报错,再点击其他地方让输入框失去焦点,此时会再次出现必填项的错误校验信息

fix(FormItem): validation input or change and blur, The animation triggers twice
fix(form-item): validation input or change and blur, The animation triggers twice
@XueHua-s XueHua-s changed the title fix(FormItem): validation input or change and blur, The animation triggers twice fix(form-item): validation input or change and blur, The animation triggers twice Jan 11, 2024
Copy link
Collaborator

@OrbisK OrbisK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for you contribution.

Before further review, please add the missing changelog entries. Please see CONTRIBUTING.md.

package.json Outdated
@@ -1,6 +1,6 @@
{
"name": "naive-ui",
"version": "2.37.3",
"version": "2.37.4",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should not be changed within a pr.

Copy link
Contributor Author

@XueHua-s XueHua-s Jan 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wrong PR has been adjusted, And the logs are supplemented

@XueHua-s
Copy link
Contributor Author

Adjusted the wrong place

@@ -5,6 +5,7 @@
### Fixes

- 修复 `n-tree` 的 `override-default-node-click-behavior` 属性可能覆盖掉默认展开按钮和选中按钮的行为
- 修复 `form-item`'s `validation` input或change后, 再blur,动画触发两次
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 修复 `form-item`'s `validation` input或change后, 再blur,动画触发两次
- 修复 `form-item`'s `validation` input 或 change 后,再blur,动画触发两次

@07akioni
Copy link
Collaborator

The issue is actually a bug, which caused by accidentally validation restoration under unexpected behavior. It's fixed in a604c4b

@07akioni 07akioni closed this Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

n-form表单错误信息动画优化
3 participants