Skip to content

Commit

Permalink
Merge pull request #124 from RaoHai/onFocus
Browse files Browse the repository at this point in the history
add `onFocus` support
  • Loading branch information
yiminghe committed Nov 1, 2016
2 parents 8f9c782 + 21e54ee commit a599a85
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/single.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ const Test = React.createClass({
console.log('onBlur', v);
},

onFocus() {
console.log('onFocus');
},

render() {
if (this.state.destroy) {
return null;
Expand All @@ -53,6 +57,7 @@ const Test = React.createClass({
dropdownMenuStyle={{ maxHeight: 200, overflow: 'auto' }}
style={{ width: 500 }}
onBlur={this.onBlur}
onFocus={this.onFocus}
allowClear
optionLabelProp="children"
optionFilterProp="text"
Expand Down
3 changes: 3 additions & 0 deletions src/Select.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const Select = React.createClass({
choiceTransitionName: PropTypes.string,
onChange: PropTypes.func,
onBlur: PropTypes.func,
onFocus: PropTypes.func,
onSelect: PropTypes.func,
onSearch: PropTypes.func,
placeholder: PropTypes.any,
Expand Down Expand Up @@ -89,6 +90,7 @@ const Select = React.createClass({
placeholder: '',
defaultValue: [],
onChange: noop,
onFocus: noop,
onBlur: noop,
onSelect: noop,
onSearch: noop,
Expand Down Expand Up @@ -306,6 +308,7 @@ const Select = React.createClass({
this.clearBlurTime();
this._focused = true;
this.updateFocusClassName();
this.props.onFocus();
},

onPopupFocus() {
Expand Down

0 comments on commit a599a85

Please sign in to comment.