-
Notifications
You must be signed in to change notification settings - Fork 409
Fixing Issue - 1655 - Dynamic form should not display any validation errors until the user clicks Save/Submit, or leaves the focus of a required control #1662
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
Conversation
|
Hi @NishkalankBezawada, thanks for this PR! I've reviewed it and couldn't make required field to display required error message during blur & submit event for new items. And after digging a bit about how the DynamicForm / DynamicField behave, it seems that the display of error messages for required fields is happening during the (re-)rendering process, which could happen for existing items but also for new ones. I think that the display error messages for required fields should rely on the events which occur (blur & submit), whether you're working on an existing item or a new one. |
|
Sorry @NishkalankBezawada, I've added my review a moth ago but forgot to submit them... 🤦♂️ |
|
Hey @michaelmaillot , Sorry for taking a lot of time. I have been away for almost a month. Hope that you would review the changes. Thanks, |
|
No worries! I'll have a look at your update and will come back to you asap! |
|
Hi @NishkalankBezawada I currently can't test your updates since the ControlsTest webpart is not the latest one (there are still Toggle buttons displayed instead of Property Pane options). See here for reference. Let me know if something's not clear regarding this. |
|
Hi @NishkalankBezawada, are you still working on this PR? Do you need any help regarding your branch update? |
Hey @michaelmaillot, I was held up with other work and couldnt find time. I will do this evening, and keep you posted :) //Nishkalank |
Unable to run gulp build or gulp serve on dev branch, Erroring out as below,
|

What's in this Pull Request?
Fixing Issue #1655
Observation
When loading a Dynamic Form with no list item id (new item), the form should not display any validation errors until the user clicks Save/Submit, or leaves the focus of a required control.
Actual behavior
When loading a Dynamic Form with no list item id (new item) all of the required fields display validation errors by default.
Solution
In
DynamicField.tsxcomponent, individual field is set and the validation is done through the methodsgetRequiredErrorText()andgetNumberErrorText()These methods currently are only checking with
changedValueproperty, which will be always empty for a new item. An additional check is done on basis oflistItemIdassuming that the fact that for new item, this will be empty, we can achieve to not to show the validation errors on the form.Below is the current implementation of the code,
neccesary changes done as below,
Screenshots
Thanks,
Nishkalank Bezawada