Skip to content

Commit 88f53b1

Browse files
committed
New prop is here disableBuiltInActiveSystem
1 parent 41f6688 commit 88f53b1

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ inactiveCardBackgroundColor?: string;
100100
| inactiveCheckboxBackgroundColor | color | "transparent" | change the inactive checkbox container background color |
101101
| activeCardBackgroundColor | color | "#2173FF" | change the active card container background color |
102102
| activeCheckboxBackgroundColor | color | "#343c4d" | change the inactive card container background color |
103+
| disableBuiltInActiveSystem | boolean | false | disable the built in active control system |
103104

104105
## Future Plans
105106

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@freakycoder/react-native-bounceable": "^0.2.4",
1414
"react": "16.13.1",
1515
"react-native": "0.63.4",
16-
"react-native-checkbox-flex": "^0.1.0",
16+
"react-native-checkbox-flex": "^0.1.1",
1717
"react-native-linear-gradient": "^2.5.6"
1818
},
1919
"devDependencies": {

lib/CheckboxFlex.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ interface ICheckboxFlexProps {
3636
imageSource: any;
3737
description?: string;
3838
titleNumberOfLines?: number;
39+
disableBuiltInActiveSystem?: boolean;
3940
style?: CustomStyleProp;
4041
iconContainerStyle?: CustomStyleProp;
4142
checkboxContainerStyle?: CustomStyleProp;
@@ -62,9 +63,11 @@ export default class CheckboxFlex extends React.Component<
6263
}
6364

6465
handlePress = () => {
65-
this.setState({ isActive: !this.state.isActive }, () => {
66-
this.props.onPress && this.props.onPress(this.state.isActive);
67-
});
66+
if (!this.props.disableBuiltInActiveSystem) {
67+
this.setState({ isActive: !this.state.isActive }, () => {
68+
this.props.onPress && this.props.onPress(this.state.isActive);
69+
});
70+
}
6871
};
6972

7073
/* -------------------------------------------------------------------------- */

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-checkbox-flex",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Fully customizable, easy to use checkbox with flexible component by React Native on Android and iOS",
55
"main": "./build/dist/CheckboxFlex.js",
66
"repository": "git@github.com:WrathChaos/react-native-checkbox-flex.git",

0 commit comments

Comments
 (0)