Skip to content

Commit

Permalink
Merge pull request #4596 from nathanmarks/fix-ie9-10-issues
Browse files Browse the repository at this point in the history
[ListItem][RadioButtonGroup] Fix error with props access in state assignment for ie9/10
  • Loading branch information
oliviertassinari committed Jul 1, 2016
2 parents 6041d9c + 43d1c0e commit 2741ca5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/List/ListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,12 +293,18 @@ class ListItem extends Component {
state = {
hovered: false,
isKeyboardFocused: false,
open: this.props.initiallyOpen,
open: false,
rightIconButtonHovered: false,
rightIconButtonKeyboardFocused: false,
touch: false,
};

componentWillMount() {
if (this.props.initiallyOpen) {
this.setState({open: true});
}
}

shouldComponentUpdate(nextProps, nextState, nextContext) {
return (
!shallowEqual(this.props, nextProps) ||
Expand Down
7 changes: 5 additions & 2 deletions src/RadioButton/RadioButtonGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class RadioButtonGroup extends Component {

state = {
numberCheckedRadioButtons: 0,
selected: this.props.valueSelected || this.props.defaultSelected || '',
selected: '',
};

componentWillMount() {
Expand All @@ -67,7 +67,10 @@ class RadioButtonGroup extends Component {
if (this.hasCheckAttribute(option)) cnt++;
}, this);

this.setState({numberCheckedRadioButtons: cnt});
this.setState({
numberCheckedRadioButtons: cnt,
selected: this.props.valueSelected || this.props.defaultSelected || '',
});
}

componentWillReceiveProps(nextProps) {
Expand Down

0 comments on commit 2741ca5

Please sign in to comment.