-
Notifications
You must be signed in to change notification settings - Fork 388
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
[Dynamic Form] Disable issue on "fieldOverrides" field control when "onBeforeSubmit" return true #1715
Comments
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible. |
I found a solution, I replaced
with ,then it works well. |
Thanks @wuxiaojun514 ! I will assign this issue to you so no one else works on it |
…foreSubmit" return true
Hi @joelfmrodrigues , |
Category
[ ] Enhancement
[x] Bug
[ ] Question
Version
Please specify what version of the library you are using: [ 3.16 ]
This issue also occurs on old version like 3.14
Expected / Desired Behavior / Question
I am using DynamicForm control and created several customized rendered fields with "fieldOverrides".
I also put validation logic (e.g. "start date" should be before "end date") in "onBeforeSubmit" method.
Then I found that if the validation failed (onBeforeSubmit return true), then my customized fields will always be disabled in the form, user cannot modify them. However user can still modify the fields which are not mentioned in "fieldOverrides".
Steps to Reproduce
I used disabled={disabled} in TextField Control
Then use this renderTextField method on DynamicForm and let onBeforeSubmit return true (validation failed)
This demo field (Job Title in my example) will be read-only after submit button clicked while the other fields still be editable
If your form has a lot fields, then user has to refresh page and fill in again after validation failed
My Trouble shooting
I did some trouble shooting on dynamic form source code.
I found that it will modify "fieldOverrides" fields's disable property when it is isSaving however it won't change "DynamicField"'s disable property. So the those "Dynamic" fields would still use its original "disable" property
Right now my temporary solution is not use disabled={disabled} in customized field control.
Hope we can find a better solution.
The text was updated successfully, but these errors were encountered: