formly-js / formly-js/angular-formly-website

FormlyFieldController $scope.model not updating after multiple submits

Open
#114 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
18
Forks
24
PR merge metrics
No merged PRs in 30d

Description

We have some validation that occurs on the backend after form submit. When this validation fails, we return an error to the front end and let the user correct whatever issues there are and resubmit the form. This is primarily address info that uses multiple fields so doing a-sync validation field by field won't work.

The problem:
After changing values in the form and clicking submit the initial incorrect values are being sent up again. When I look at the contents of the form on submit, I see that all value fields on the form object reflect the updated values (modelValue, lastCommittedViewValue, and rawModelValue). However, when calling .value() on the individual fields, I'm instead getting the old initial values. Is there some way to get the fields model to be consistent with the other model values I'm seeing?

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the multiple-submit scenario described for FormlyFieldController, comparing the form's model values with each field's .value() after backend validation fails. Done means corrected values are returned on the next submit rather than the initial values.

Written by the indexing model from the issue text.

Assessment

Tech stack
angularjs, javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.