Skip to content

Commit

Permalink
Updating Custom Option Component
Browse files Browse the repository at this point in the history
  • Loading branch information
JedWatson committed Oct 29, 2015
1 parent 066a8de commit 89af12a
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions examples/src/components/CustomOption.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ var Option = React.createClass({
option: React.PropTypes.object.isRequired,
renderFunc: React.PropTypes.func
},
handleMouseDown (e) {
this.props.mouseDown(this.props.option, e);
},
handleMouseEnter (e) {
this.props.mouseEnter(this.props.option, e);
},
handleMouseLeave (e) {
this.props.mouseLeave(this.props.option, e);
},
render () {
var obj = this.props.option;
var size = 15;
Expand All @@ -24,10 +33,10 @@ var Option = React.createClass({
};
return (
<div className={this.props.className}
onMouseEnter={this.props.mouseEnter}
onMouseLeave={this.props.mouseLeave}
onMouseDown={this.props.mouseDown}
onClick={this.props.mouseDown}>
onMouseEnter={this.handleMouseEnter}
onMouseLeave={this.handleMouseLeave}
onMouseDown={this.handleMouseDown}
onClick={this.handleMouseDown}>
<Gravatar email={obj.email} size={size} style={gravatarStyle} />
{obj.value}
</div>
Expand Down

0 comments on commit 89af12a

Please sign in to comment.