json-schema-form / angular-schema-form

Generate forms from a JSON schema, with AngularJS!
https://json-schema-form.github.io/angular-schema-form
MIT License
2.47k stars 653 forks source link

Can't overwrite default updateOn when using radios #818

Open toccoto opened 7 years ago

toccoto commented 7 years ago

Expected behaviour

When I use radio-inline with a default ngModelOptions updateOn set to blur, but a local updateOn set to default, the local one should override the global.

snippet:

$scope.formOptions = { destroyStrategy: 'retain', formDefaults: { feedback: false, ngModelOptions: { updateOn: 'blur' } } };

snippet for schema:

{ "type": "section", "htmlClass": "row", "items": [{ "type": "section", "htmlClass": "col-xs-12", "items": [{ "type": "radios-inline", "key": "mailAddrSame", ngModelOptions: { updateOn: 'default' } }] }] }

Actual behaviour

The blur still overrides the default. Looking at the html, I see the following:

<label ng-model="model['mailAddrSame']" ng-model-options="form.ngModelOptions" schema-validate="form" class="control-label" ng-show="showTitle()">Residential Address same as Mailing Address</label>

I'm not sure if the ng-model-options should be on the label?

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

Anthropic commented 7 years ago

Thanks @toccoto I assume that setting it to change instead of default doesn't fix anything? Were you able to make any changes to templates that fixed it for you?