Form IsTouched not updating until second item changes
Bug type
Component
Component name
MudForm
What happened?
When editing a text field or a check box in a form, the IsTouched value of the form is not updated until you change two things.
Expected behavior
Setting the value of a field in a form should update the IsTouched value of the form on the first edit.
Reproduction link
https://try.mudblazor.com/snippet/maQHYGagByDiJgBz
Reproduction steps
- Set value of text box or check box
- Observer the button is still disabled
- Set value of other field
- Observe the button is no longer disabled ...
Relevant log output
No response
Version (bug)
6.1.8
Version (working)
No response
What browsers are you seeing the problem on?
Microsoft Edge
On what operating system are you experiencing the issue?
Windows
Pull Request
- [ ] I would like to do a Pull Request
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Updated code to show how it should work:
https://try.mudblazor.com/snippet/cOGRkGYUhzzGNMhw
You can use ValidationDelay="0", this snippet should do what you want it to: https://try.mudblazor.com/snippet/cOQnOGYiyQZYgNMe
Technically speaking though, your snippet should still produce the same result as my snippet, just with a delay of 300ms, could definitely be considered a bug.
@igotinfected I'm new to MudBlazor, but there may be a connection in that the OnFieldChanged event seems to fire before the IsTouchedChanged event.
Not catching the first change is a bug unless it's defined some way that I don't understand. I only wish I knew enough to fix it.
I would like to make a little up for this bug.
The solution proposed by @igotinfected unfortunately isn't working if the first field edited is a MudSelect.
This issue has been marked as stale.
If you have any updates or additional information, please comment below.
If no response is received, it will be automatically closed.