Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rc-util #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down Expand Up @@ -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();
}
Expand All @@ -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();
Expand All @@ -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();
Expand Down Expand Up @@ -681,4 +681,4 @@ var Select = _react2['default'].createClass({
});

exports['default'] = Select;
module.exports = exports['default'];
module.exports = exports['default'];