Skip to content

Commit

Permalink
Fix ToggleButton defaultSelected behavior #204
Browse files Browse the repository at this point in the history
  • Loading branch information
metagrover committed Sep 4, 2017
1 parent 3b479d9 commit 38498e1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/sensors/ToggleButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ export default class ToggleButton extends Component {
// Set query information
componentWillMount() {
this.setQueryInfo(this.props);
this.checkDefault(this.props);
setTimeout(() => {
this.checkDefault(this.props);
}, 100);
this.listenFilter();
}

Expand Down Expand Up @@ -115,7 +117,7 @@ export default class ToggleButton extends Component {

// handle the input change and pass the value inside sensor info
handleChange(record, setTrue = false) {
let selected = this.state.selected;
let { selected } = this.state;
let newSelection = null;
let selectedIndex = null;

Expand Down

0 comments on commit 38498e1

Please sign in to comment.