@@ -25,7 +25,6 @@ interface Params {
2525 DOMResults : HTMLElement ;
2626 Request : XMLHttpRequest ;
2727 Input : Element ;
28- Select : Element ;
2928
3029 // Workflow methods
3130 _Blur : any ;
@@ -189,7 +188,6 @@ class AutoComplete {
189188 DOMResults : null ,
190189 Request : null ,
191190 Input : null ,
192- Select : null ,
193191
194192 /**
195193 * Return the message when no result returns
@@ -429,19 +427,6 @@ class AutoComplete {
429427 this . Input . value = item . innerHTML ;
430428 }
431429 this . Input . setAttribute ( "data-autocomplete-old-value" , this . Input . value ) ;
432-
433- if ( this . Select !== void 0 ) {
434- var option : HTMLElement = document . createElement ( "option" ) ;
435- option . setAttribute ( "value" , this . Input . value ) ;
436- option . setAttribute ( "selected" , "selected" ) ;
437- option . innerHTML = item . innerHTML ;
438-
439- if ( this . Select . hasChildNodes ( ) ) {
440- this . Select . childNodes [ 0 ] . remove ( ) ;
441- }
442-
443- this . Select . appendChild ( option ) ;
444- }
445430 } ,
446431
447432 $AjaxTimer : null ,
@@ -479,28 +464,7 @@ class AutoComplete {
479464 console . log ( "Object" , params ) ;
480465 console . log ( element )
481466
482- if ( element . nodeName . match ( / ^ S E L E C T $ / i) ) {
483- params . Select = element ;
484-
485- params . Select . setAttribute ( "style" , "display:none;" ) ;
486-
487- var input = document . createElement ( "input" ) ;
488- input . setAttribute ( "type" , "search" ) ;
489- input . setAttribute ( "autocomplete" , "off" ) ;
490-
491- params . Select . parentNode . appendChild ( input ) ;
492-
493- var attributes : NamedNodeMap = params . Select . attributes ;
494- for ( var i = attributes . length - 1 ; i >= 0 ; i -- ) {
495- if ( attributes [ i ] . name . match ( / ^ d a t a - a u t o c o m p l e t e / i) ) {
496- input . setAttribute ( attributes [ i ] . name , attributes [ i ] . value ) ;
497- }
498- }
499-
500- params . Input = input ;
501- } else {
502- params . Input = element ;
503- }
467+ params . Input = element ;
504468
505469 if ( params . Input . nodeName . match ( / ^ I N P U T $ / i) && params . Input . getAttribute ( "type" ) . match ( / ^ T E X T | S E A R C H $ / i) ) {
506470 params . Input . setAttribute ( "autocomplete" , "off" ) ;
0 commit comments