SamProf / MatBlazor

Material Design components for Blazor and Razor Components
http://www.matblazor.com
MIT License
2.84k stars 386 forks source link

Implement support for EditContext #123

Closed ApocDev closed 4 years ago

ApocDev commented 5 years ago

There is currently no support whatsoever for EditContext (via EditForm https://docs.microsoft.com/en-us/aspnet/core/blazor/forms-validation?view=aspnetcore-3.0)

All of the input-based controls should support EditContext so we can leverage built-in client-side validation.

jorgy343 commented 5 years ago

I'm currently investigating integrating validation into MatTextField. I have it mostly working but it's a bit of a mess right now. The approach I would like to take is to be able to derive from MatTextField and add the validation functionality instead of modifying MatTextField directly.

ApocDev commented 5 years ago

I'm currently investigating integrating validation into MatTextField. I have it mostly working but it's a bit of a mess right now. The approach I would like to take is to be able to derive from MatTextField and add the validation functionality instead of modifying MatTextField directly.

Agreed. I wound up copying MatTextField and making far too many changes just to enable validation. (MatBlazor isn't very extensible in that respect)

Optionally, MatTextField could just use the InputText and InputTextArea controls to handle it without most of the fuss.

jorgy343 commented 5 years ago

I added support for validation for MatTextField in a branch in my repository found at https://github.com/jorgy343/MatBlazor/tree/ex-TextField-Validation. It only supports strings but adding arbitrary types won't be hard.

ebekker commented 5 years ago

I've started work in PR #178 to address this, if folks want to review and provide feedback.

lindespang commented 4 years ago

Hello! This is now possible to do in MatBlazor. See example here:

https://www.matblazor.com/EditContext

Closing issue.