aboutsummaryrefslogtreecommitdiffstats
path: root/src/widgets.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets.js')
-rw-r--r--src/widgets.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/widgets.js b/src/widgets.js
index 4eae735f..7de4bdc1 100644
--- a/src/widgets.js
+++ b/src/widgets.js
@@ -155,9 +155,15 @@ function initWidgetValue(initValue) {
function radioInit(model, view, element) {
var modelValue = model.get(), viewValue = view.get(), input = element[0];
+ input.checked = false;
input.name = this.$id + '@' + input.name;
- if (isUndefined(modelValue)) model.set(null);
- if (viewValue !== null) model.set(viewValue);
+ if (isUndefined(modelValue)) {
+ model.set(modelValue = null);
+ }
+ if (modelValue == null && viewValue !== null) {
+ model.set(viewValue);
+ }
+ view.set(modelValue);
}
function inputWidget(events, modelAccessor, viewAccessor, initFn) {