@@ -54,14 +54,14 @@ class Combobox extends React.Component {
54
54
55
55
componentWillReceiveProps ( newProps ) {
56
56
this . setState ( { menu : this . makeMenu ( newProps . children ) } , function ( ) {
57
- if ( newProps . children . length && ( this . isOpen || document . activeElement === this . refs . input ) ) {
57
+ if ( newProps . children . length && ( this . isOpen || document . activeElement === this . input ) ) {
58
58
if ( ! this . state . menu . children . length ) {
59
59
return
60
60
}
61
61
this . setState ( {
62
62
isOpen : true
63
63
} , function ( ) {
64
- this . refs . list . scrollTop = 0 ;
64
+ this . list . scrollTop = 0 ;
65
65
} . bind ( this ) )
66
66
} else {
67
67
this . hideList ( ) ;
@@ -134,7 +134,7 @@ class Combobox extends React.Component {
134
134
} ;
135
135
136
136
handleInputChange = ( ) => {
137
- var value = this . refs . input . value ;
137
+ var value = this . input . value ;
138
138
this . clearSelectedState ( function ( ) {
139
139
this . props . onInput ( value ) ;
140
140
} . bind ( this ) ) ;
@@ -208,11 +208,11 @@ class Combobox extends React.Component {
208
208
} ;
209
209
210
210
focusInput = ( ) => {
211
- this . refs . input . focus ( ) ;
211
+ this . input . focus ( ) ;
212
212
} ;
213
213
214
214
selectInput = ( ) => {
215
- this . refs . input . select ( ) ;
215
+ this . input . select ( ) ;
216
216
}
217
217
218
218
inputKeydownMap = {
@@ -285,15 +285,15 @@ class Combobox extends React.Component {
285
285
if ( options . focus !== false )
286
286
this . selectInput ( ) ;
287
287
} . bind ( this ) ) ;
288
- this . refs . input . value = '' // added
288
+ this . input . value = '' // added
289
289
} ;
290
290
291
291
selectText = ( ) => {
292
- var value = this . refs . input . value ;
292
+ var value = this . input . value ;
293
293
if ( ! value ) return ;
294
294
this . props . onSelect ( value ) ;
295
295
this . clearSelectedState ( ) ;
296
- this . refs . input . value = '' // added
296
+ this . input . value = '' // added
297
297
} ;
298
298
299
299
focusNext = ( event ) => {
@@ -304,7 +304,7 @@ class Combobox extends React.Component {
304
304
} ;
305
305
306
306
removeLastToken = ( ) => {
307
- if ( this . props . onRemoveLast && ! this . refs . input . value ) {
307
+ if ( this . props . onRemoveLast && ! this . input . value ) {
308
308
this . props . onRemoveLast ( )
309
309
}
310
310
return true
@@ -387,7 +387,7 @@ class Combobox extends React.Component {
387
387
388
388
focusOption = ( ) => {
389
389
var index = this . state . focusedIndex ;
390
- this . refs . list . childNodes [ index ] . focus ( ) ;
390
+ this . list . childNodes [ index ] . focus ( ) ;
391
391
} ;
392
392
393
393
state = {
@@ -419,7 +419,7 @@ class Combobox extends React.Component {
419
419
{ this . props . value }
420
420
{ this . state . inputValue }
421
421
< input
422
- ref = " input"
422
+ ref = { e => this . input = e }
423
423
autoComplete = "off"
424
424
spellCheck = "false"
425
425
aria-label = { ariaLabel }
@@ -447,7 +447,7 @@ class Combobox extends React.Component {
447
447
</ span >
448
448
< div
449
449
id = { this . state . listId }
450
- ref = " list"
450
+ ref = { e => this . list = e }
451
451
className = "ic-tokeninput-list"
452
452
role = "listbox" >
453
453
{ this . state . menu . children }
0 commit comments