The correct use of IsTouched #3851
Unanswered
johndhunter
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi - having some really good results using MudBlazor ( got my complex fluent validition (nested) working - even with the DatePicker (using the workaround in the OnAfterRender), but I'm having some problem understanding why IsTouched is not being raised when my input controls change:
I have a form thus:
<MudForm Model="@_updateProfileRequestDto" @ref="@_editForm" IsTouchedChanged="((e) => IsTouchChanged(e))">
and a handler for that:
private void IsTouchChanged(bool eventArgs) { isTouched = eventArgs; }
I'm keeping my isTouched separate (I know I could use _editForm.IsTouched) as my navigation is done by popping a dialog over a mudtable and using prev/next via an internal bus to drive through the table (paging etc included)
Anyway - first load of the dialog (and thus the first record double clicked by the user) and IsTouchedChanged s correctly not invoked.
However - despite the fluent validation correctly noting changes to input fields in the form, IsTouchedChanged is never invoked again (except once - when I simply go "next" the first time - subsequent next's do nothing) so just navigating without changing anything works - but I want to invoke the saving of a record when it's modified rather than every time I navigate and I'm a bit stuck.
If anyone needs more code to play with I can do that.
I looked through the repo specifically for the units test around the IsTouched but couldn't work out a decent one to simulate my issue.
TIA for any assistance.
Beta Was this translation helpful? Give feedback.
All reactions