formly-js / angular-formly

JavaScript powered forms for AngularJS
http://docs.angular-formly.com
MIT License
2.22k stars 405 forks source link

Enter key on input will jump over validation, why? any solutions? #588

Closed nextglory closed 8 years ago

nextglory commented 8 years ago

In the second step of demo: http://angular-formly.com/#/example/integrations/angular-wizard

If you click the enter key, it will go to the next step, even when the fields are required.

Any solutions on this?

nextglory commented 8 years ago

I found that when enter key is fired, the form $valid state is true, this is whird.

benoror commented 8 years ago

This is not handled by angular-formly, but by the 3rd party wizard directive

In their docs you can read how they handle step validation: https://github.com/mgonto/angular-wizard#wizard-step-validation

Fixed example: http://jsbin.com/fexuji/1/edit?html,js,console,output

nextglory commented 8 years ago

benoror, awesome, I checked your code and amazingly cool.....

benoror commented 8 years ago

:smile: