ee8c7f77 by Michael Richards

Set input value for radio buttons as el.checked.

1 parent 0c9223d6
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
25 case 'select-one': 25 case 'select-one':
26 return el.value; 26 return el.value;
27 case 'checkbox': 27 case 'checkbox':
28 case 'radio':
28 return el.checked; 29 return el.checked;
29 } 30 }
30 }; 31 };
......
...@@ -17,7 +17,7 @@ registerBinding = (el, adapter, type, context, keypath) -> ...@@ -17,7 +17,7 @@ registerBinding = (el, adapter, type, context, keypath) ->
17 getInputValue = (el) -> 17 getInputValue = (el) ->
18 switch el.type 18 switch el.type
19 when 'text', 'textarea', 'password', 'select-one' then el.value 19 when 'text', 'textarea', 'password', 'select-one' then el.value
20 when 'checkbox' then el.checked 20 when 'checkbox', 'radio' then el.checked
21 21
22 attributeBinding = (attr) -> (el, value) -> 22 attributeBinding = (attr) -> (el, value) ->
23 if value then el.setAttribute attr, value else el.removeAttribute attr 23 if value then el.setAttribute attr, value else el.removeAttribute attr
......