Fixes dev/core#3450
Allows the value of radio buttons to be unset if the field is not required,
consistent with the rest of the CiviCRM UI.
<input class="crm-form-radio" type="radio" ng-checked="defaultValueContains(opt.id)" ng-click="toggleDefaultValueItem(opt.id)" >
{{ opt.label }}
</label>
+ <a href ng-if="!getProp('required')" class="crm-hover-button" title="{{:: ts('Clear Default') }}" ng-click="toggleDefaultValueItem(getSet('afform_default'))">
+ <i class="crm-i fa-times" aria-hidden="true"></i>
+ </a>
</div>
<input class="crm-form-radio" type="radio" ng-model="dataProvider.getFieldData()[$ctrl.fieldName]" ng-value="opt.id" />
{{:: opt.label }}
</label>
+<a ng-if="!$ctrl.defn.required" class="crm-hover-button" title="{{:: ts('Clear') }}" ng-show="!!dataProvider.getFieldData()[$ctrl.fieldName] || dataProvider.getFieldData()[$ctrl.fieldName] === false || dataProvider.getFieldData()[$ctrl.fieldName] === 0" ng-click="dataProvider.getFieldData()[$ctrl.fieldName] = null">
+ <i class="crm-i fa-times" aria-hidden="true"></i>
+</a>