Skip to content

Commit

Permalink
Fixed a typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharlaan committed Oct 12, 2017
1 parent b9bb8da commit 723e4d8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion lib/SuperSelectField.js
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,13 @@ var SelectField = function (_Component2) {
});
}
}
}, {
key: 'componentDidMount',
value: function componentDidMount() {
// Potential problem with Popover ?
// https://github.com/callemall/material-ui/blob/master/src/DropDownMenu/DropDownMenu.js#L237
if (this.props.openImmediately) this.openMenu();
}

// Counts nodes with non-null value property without optgroups
// noinspection JSMethodCanBeStatic
Expand Down Expand Up @@ -540,7 +547,7 @@ var SelectField = function (_Component2) {
value: function openMenu() {
var _this4 = this;

if (!this.satte.isOpen) this.props.onMenuOpen();
if (!this.state.isOpen) this.props.onMenuOpen();
if (this.state.itemsLength) this.setState({ isOpen: true }, function () {
return _this4.focusTextField();
});
Expand Down Expand Up @@ -944,6 +951,7 @@ SelectField.propTypes = {
menuCloseButton: _propTypes2.default.node,
canAutoPosition: _propTypes2.default.bool,
multiple: _propTypes2.default.bool,
openImmediately: _propTypes2.default.bool,
disabled: _propTypes2.default.bool,
onChange: _propTypes2.default.func,
onMenuOpen: _propTypes2.default.func,
Expand All @@ -958,6 +966,7 @@ SelectField.defaultProps = {
menuCloseButton: null,
canAutoPosition: true,
multiple: false,
openImmediately: false,
disabled: false,
nb2show: 5,
hintText: 'Click me',
Expand Down
2 changes: 1 addition & 1 deletion src/SuperSelectField.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ class SelectField extends Component {
}

openMenu () {
if (!this.satte.isOpen) this.props.onMenuOpen()
if (!this.state.isOpen) this.props.onMenuOpen()
if (this.state.itemsLength) this.setState({ isOpen: true }, () => this.focusTextField())
}

Expand Down

0 comments on commit 723e4d8

Please sign in to comment.