Skip to content

Commit 3ee6d80

Browse files
committed
default value of checked is now false
1 parent d142a80 commit 3ee6d80

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/bootstrap-switch-button-react.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ export default class BootstrapSwitchButton extends React.Component {
3636

3737
this.state = {
3838
checked:
39-
typeof this.props.checked === "boolean" ? this.props.checked : true,
39+
typeof this.props.checked === "boolean" ? this.props.checked : false,
4040
disabled:
4141
typeof this.props.disabled === "boolean" ? this.props.disabled : false,
4242
onlabel: this.props.onlabel || "On",
43-
onstyle: this.props.onstyle || "primary",
4443
offlabel: this.props.offlabel || "Off",
44+
onstyle: this.props.onstyle || "primary",
4545
offstyle: this.props.offstyle || "light",
4646
size: this.props.size || "",
4747
style: this.props.style || "",
@@ -85,8 +85,9 @@ export default class BootstrapSwitchButton extends React.Component {
8585
this.state.width ? (switchStyle.width = this.state.width + "px") : null;
8686
this.state.height ? (switchStyle.height = this.state.height + "px") : null;
8787

88-
let labelStyle = {}
89-
if ( this.state.height ) labelStyle.lineHeight = 'calc('+ this.state.height + 'px * 0.8)';
88+
let labelStyle = {};
89+
if (this.state.height)
90+
labelStyle.lineHeight = "calc(" + this.state.height + "px * 0.8)";
9091

9192
return (
9293
<div
@@ -118,7 +119,7 @@ export default class BootstrapSwitchButton extends React.Component {
118119
this.state.offstyle +
119120
(this.state.size ? " btn-" + this.state.size : "")
120121
}
121-
style={labelStyle}
122+
style={labelStyle}
122123
>
123124
{this.state.offlabel}
124125
</label>

0 commit comments

Comments
 (0)