@@ -148,6 +148,8 @@ let Autocomplete = React.createClass({
148148 } ,
149149
150150 componentWillMount ( ) {
151+ // this.refs is frozen, so we need to assign a new object to it
152+ this . refs = { }
151153 this . _ignoreBlur = false
152154 this . _performAutoCompleteOnUpdate = false
153155 this . _performAutoCompleteOnKeyUp = false
@@ -376,7 +378,7 @@ let Autocomplete = React.createClass({
376378 onMouseDown : ( ) => this . setIgnoreBlur ( true ) , // Ignore blur to prevent menu from de-rendering before we can process click
377379 onMouseEnter : ( ) => this . highlightItemFromMouse ( index ) ,
378380 onClick : ( ) => this . selectItemFromMouse ( item ) ,
379- ref : `item-${ index } ` ,
381+ ref : e => this . refs [ `item-${ index } ` ] = e ,
380382 } )
381383 } )
382384 const style = {
@@ -385,7 +387,7 @@ let Autocomplete = React.createClass({
385387 minWidth : this . state . menuWidth ,
386388 }
387389 const menu = this . props . renderMenu ( items , this . props . value , style )
388- return React . cloneElement ( menu , { ref : ' menu' } )
390+ return React . cloneElement ( menu , { ref : e => this . refs . menu = e } )
389391 } ,
390392
391393 handleInputBlur ( ) {
@@ -452,7 +454,7 @@ let Autocomplete = React.createClass({
452454 aria-autocomplete = "list"
453455 aria-expanded = { open }
454456 autoComplete = "off"
455- ref = " input"
457+ ref = { e => this . refs . input = e }
456458 onFocus = { this . composeEventHandlers ( this . handleInputFocus , inputProps . onFocus ) }
457459 onBlur = { this . composeEventHandlers ( this . handleInputBlur , inputProps . onBlur ) }
458460 onChange = { this . handleChange }
0 commit comments