File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,9 @@ sfPath, sfSelect) {
197
197
scope . ngModel . $setValidity ( error , validity === true ) ;
198
198
199
199
if ( validity === true ) {
200
+ // Re-trigger model validator, that model itself would be re-validated
201
+ scope . ngModel . $validate ( ) ;
202
+
200
203
// Setting or removing a validity can change the field to believe its valid
201
204
// but its not. So lets trigger its validation as well.
202
205
scope . $broadcast ( 'schemaFormValidate' ) ;
Original file line number Diff line number Diff line change @@ -78,14 +78,16 @@ export default function($compileProvider, sfPathProvider) {
78
78
scope . buttonClick = function ( $event , form ) {
79
79
if ( angular . isFunction ( form . onClick ) ) {
80
80
form . onClick ( $event , form ) ;
81
- } else if ( angular . isString ( form . onClick ) ) {
81
+ }
82
+ else if ( angular . isString ( form . onClick ) ) {
82
83
if ( sfSchema ) {
83
84
//evaluating in scope outside of sfSchemas isolated scope
84
85
sfSchema . evalInParentScope ( form . onClick , { '$event' : $event , form : form } ) ;
85
- } else {
86
- scope . $eval ( form . onClick , { '$event' : $event , form : form } ) ;
87
86
}
88
- }
87
+ else {
88
+ scope . $eval ( form . onClick , { '$event' : $event , form : form } ) ;
89
+ } ;
90
+ } ;
89
91
} ;
90
92
91
93
/**
@@ -267,6 +269,9 @@ export default function($compileProvider, sfPathProvider) {
267
269
scope . ngModel . $setValidity ( error , validity === true ) ;
268
270
269
271
if ( validity === true ) {
272
+ // Re-trigger model validator, that model itself would be re-validated
273
+ scope . ngModel . $validate ( ) ;
274
+
270
275
// Setting or removing a validity can change the field to believe its valid
271
276
// but its not. So lets trigger its validation as well.
272
277
scope . $broadcast ( 'schemaFormValidate' ) ;
You can’t perform that action at this time.
0 commit comments