Skip to content
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

Form not validating correctly when model already has data #44

Open
mark007 opened this issue May 24, 2017 · 0 comments
Open

Form not validating correctly when model already has data #44

mark007 opened this issue May 24, 2017 · 0 comments

Comments

@mark007
Copy link

mark007 commented May 24, 2017

Enhancement

As a user/developer, when I load a form where the model already has some fields filled in I should be able to see that those fields are invalid.

Expected behaviour

I expected the form to show an indication that the field was invalid.

Actual behaviour

It actually shows a green tick / indication that it is valid. Only upon changing a character, does it retrigger the form to show correct validation.

Gist/Plunker/Demo

This example has one field, which should be either the string "true" or "false". When the model / data has the field pre populated to something else, eg "bla", the form shows it as green / valid on initial page load.
https://plnkr.co/edit/8mVtMFv4UK7DT0VQztfY?p=preview

This plunker was forked from another so it may not be the absolute latest version, but I'm using the latest commit id from github and its reproducible locally.

Is this fixable with a form option or is it an actual bug?

Similarly when I enable validateOnRender in the form options, I was hoping that would also mark the field as invalid on initial load, when the model / data didn't have anything populated for that field, but it leaves it invalidated. I'm not sure if this is related or a separate ticket I should create. My intention that all fields explicitly show as red / green on initial page load, and my custom submit button is set to hide if the form is $invalid.

@json-schema-form/angular-schema-form-bootstrap-lead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant