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

bug(ValidateForm): MetadataType 方式如果继承了 IValidateCollection 概率不显示单属性错误提示 #4359

Closed
1 task done
AiYuZhen opened this issue Sep 26, 2024 · 2 comments · Fixed by #4360
Closed
1 task done
Assignees
Labels
bug Something isn't working
Milestone

Comments

@AiYuZhen
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

使用 MetadataType 方式附加的类型如果继承了 IValidateCollection,特定情况下不显示对单个属性的验证错误信息。

Expected Behavior

正确显示属性验证错误信息。

Interactive render mode

Interactive Server (Interactive server-side rendering (interactive SSR) using Blazor Server)

Steps To Reproduce

Test.zip

示例中限制了不能输入 0 ,打断点验证代码也执行并正确返回了,但还界面还是显示验证通过了

image
image

但如果把上面的 【地块面积(亩)】也加入验证,则就能正确显示错误了

image
image

Exceptions (if any)

No response

.NET Version

vs2022 17.11.4 .net 8.0

Anything else?

No response

@AiYuZhen AiYuZhen added the bug Something isn't working label Sep 26, 2024
Copy link

bb-auto bot commented Sep 26, 2024

@AiYuZhen Thank you for filing this issue. In order for us to investigate this issue, please provide a minimalistic repro project that illustrates the problem.

@bb-auto bb-auto bot added this to the v8.9.0 milestone Sep 26, 2024
@ArgoZhang
Copy link
Collaborator

ArgoZhang commented Sep 26, 2024

@AiYuZhen 稍等我调试一下吧

ArgoZhang added a commit that referenced this issue Sep 26, 2024
* 修复 MetadataType 方式继承 IValidateCollection 接口验证后又对其中涉及的属性进行了单独验证,在特定情况下会忽略单独验证的错误提示。#4359

* fix: 更新 ValidateForm 验证逻辑

* refactor: 重构代码

* refactor: 更改 IValidateCollection 接口方法名称

* 调整代码以通过验证。

* doc: 增加注释文档

* refactor: 精简代码

* test: 更新单元测试

* chore: bump version 8.9.4-beta06

---------

Co-authored-by: Argo <argo@live.ca>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants