aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Select.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/Select.jsx')
-rw-r--r--src/Select.jsx8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Select.jsx b/src/Select.jsx
index 49fed5b..a51ffd2 100644
--- a/src/Select.jsx
+++ b/src/Select.jsx
@@ -79,7 +79,7 @@ class Select extends Component {
79 scrollToSelected(duration) { 79 scrollToSelected(duration) {
80 // move to selected item 80 // move to selected item
81 const select = ReactDom.findDOMNode(this); 81 const select = ReactDom.findDOMNode(this);
82 const list = ReactDom.findDOMNode(this.refs.list); 82 const list = ReactDom.findDOMNode(this.list);
83 if (!list) { 83 if (!list) {
84 return; 84 return;
85 } 85 }
@@ -101,6 +101,10 @@ class Select extends Component {
101 this.setState({ active: false }); 101 this.setState({ active: false });
102 } 102 }
103 103
104 saveList = (node) => {
105 this.list = node;
106 }
107
104 render() { 108 render() {
105 if (this.props.options.length === 0) { 109 if (this.props.options.length === 0) {
106 return null; 110 return null;
@@ -118,7 +122,7 @@ class Select extends Component {
118 onMouseEnter={this.handleMouseEnter} 122 onMouseEnter={this.handleMouseEnter}
119 onMouseLeave={this.handleMouseLeave} 123 onMouseLeave={this.handleMouseLeave}
120 > 124 >
121 <ul ref="list">{this.getOptions()}</ul> 125 <ul ref={this.saveList}>{this.getOptions()}</ul>
122 </div> 126 </div>
123 ); 127 );
124 } 128 }