diff --git a/lib/Select.js b/lib/Select.js index b5adc05..c23d737 100644 --- a/lib/Select.js +++ b/lib/Select.js @@ -18,7 +18,7 @@ var _reactDom = require('react-dom'); var _reactDom2 = _interopRequireDefault(_reactDom); -var _rcUtil = require('rc-util'); +var _keyCode = require('rc-util/lib/KeyCode'); var _classnames = require('classnames'); @@ -199,7 +199,7 @@ var Select = _react2['default'].createClass({ var keyCode = event.keyCode; if (this.state.open && !this.getInputDOMNode()) { this.onInputKeyDown(event); - } else if (keyCode === _rcUtil.KeyCode.ENTER || keyCode === _rcUtil.KeyCode.DOWN) { + } else if (keyCode === _KeyCode.ENTER || keyCode === _KeyCode.DOWN) { this.setOpenState(true); event.preventDefault(); } @@ -224,7 +224,7 @@ var Select = _react2['default'].createClass({ } var state = this.state; var keyCode = event.keyCode; - if ((0, _util.isMultipleOrTags)(props) && !event.target.value && keyCode === _rcUtil.KeyCode.BACKSPACE) { + if ((0, _util.isMultipleOrTags)(props) && !event.target.value && keyCode === _KeyCode.BACKSPACE) { var value = state.value.concat(); if (value.length) { var label = state.label.concat(); @@ -235,14 +235,14 @@ var Select = _react2['default'].createClass({ } return; } - if (keyCode === _rcUtil.KeyCode.DOWN) { + if (keyCode === _KeyCode.DOWN) { if (!state.open) { this.openIfHasChildren(); event.preventDefault(); event.stopPropagation(); return; } - } else if (keyCode === _rcUtil.KeyCode.ESC) { + } else if (keyCode === _KeyCode.ESC) { if (state.open) { this.setOpenState(false); event.preventDefault(); @@ -681,4 +681,4 @@ var Select = _react2['default'].createClass({ }); exports['default'] = Select; -module.exports = exports['default']; \ No newline at end of file +module.exports = exports['default'];