Skip to content
This repository was archived by the owner on Aug 23, 2022. It is now read-only.

Commit 7e9fbf1

Browse files
committed
Fixed bug from Issue 905, with checkbox defaultChecked not working properly
1 parent 8bef6c4 commit 7e9fbf1

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/actions/model-actions.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,11 @@ export function createModelActions(s = defaultStrategies) {
9696
return change(model, multiValue);
9797
}
9898

99-
return change(model, !currentValue);
99+
if (typeof value === 'undefined') {
100+
return change(model, !currentValue);
101+
} else {
102+
return change(model, value);
103+
}
100104
};
101105

102106
const check = (model, value) => (dispatch, getState) => {

src/constants/control-props-map.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ const controlPropsMap = {
5757
},
5858
checkbox: {
5959
...standardPropsMap,
60-
checked: (props) => (props.defaultChecked
61-
? props.checked
62-
: isChecked(props)),
60+
checked: isChecked,
6361
},
6462
radio: {
6563
...standardPropsMap,

0 commit comments

Comments
 (0)