From 89af12a80a972794222b193a767f44234bbe9817 Mon Sep 17 00:00:00 2001 From: Jed Watson Date: Thu, 29 Oct 2015 22:35:56 +1100 Subject: [PATCH] Updating Custom Option Component --- examples/src/components/CustomOption.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/examples/src/components/CustomOption.js b/examples/src/components/CustomOption.js index 90556e07ec..cb7254a90a 100644 --- a/examples/src/components/CustomOption.js +++ b/examples/src/components/CustomOption.js @@ -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; @@ -24,10 +33,10 @@ var Option = React.createClass({ }; return (
+ onMouseEnter={this.handleMouseEnter} + onMouseLeave={this.handleMouseLeave} + onMouseDown={this.handleMouseDown} + onClick={this.handleMouseDown}> {obj.value}