masastack / MASA.Blazor

Blazor UI component library based on Material Design. Support Blazor Server, Blazor WebAssembly and MAUI Blazor.
https://docs.masastack.com/blazor/getting-started/installation
MIT License
1.12k stars 151 forks source link

[Bug Report]: add ValidateOnBlur attribute to MTextField component is invalid #1211

Closed MapleWithoutWords closed 1 year ago

MapleWithoutWords commented 1 year ago

Masa.Blazor version

1.0.0-preview.12

Describe the bug

I add ValidateOnBlur attribute to MTextField component,and use @bind-Value binding Title property,and add fluentvalidation validation image image image

Expected Behavior

No response

Steps To Reproduce

No response

Reproduction code

No response

.NET version

No response

What browsers are you seeing the problem on?

No response

Additional context

No response

doddgu commented 1 year ago

@capdiem PTAL

capdiem commented 1 year ago

@MapleWithoutWords 我简单测试了下,ValidateOnBlur在使用Rules、或Form的DataAnnotations 和Fluent验证都是可用的。如果是MForm绑定的Model是UpsertPanelDto的父类,那应该还得在父类的Validator里设置此类的validator。具体参考例子:https://docs.masastack.com/blazor/components/forms#section-901a8fc7-fluentvalidation-9a8c8bc196c65408

MapleWithoutWords commented 1 year ago

@MapleWithoutWords 我简单测试了下,ValidateOnBlur在使用Rules、或Form的DataAnnotations 和Fluent验证都是可用的。如果是MForm绑定的Model是UpsertPanelDto的父类,那应该还得在父类的Validator里设置此类的validator。具体参考例子:https://docs.masastack.com/blazor/components/forms#section-901a8fc7-fluentvalidation-9a8c8bc196c65408

我的场景没有MForm,那我感觉这个属性没啥用

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 4 days with no activity.

doddgu commented 1 year ago

?

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 4 days with no activity.

github-actions[bot] commented 1 year ago

This issue is closed because it has been open for 3 days with stale.