File tree Expand file tree Collapse file tree 1 file changed +3
-15
lines changed Expand file tree Collapse file tree 1 file changed +3
-15
lines changed Original file line number Diff line number Diff line change 48
48
. insertAfter ( select ) ;
49
49
50
50
function removeIfInvalid ( element ) {
51
- var value = $ ( element ) . val ( ) ,
52
- matcher = new RegExp ( "^" + $ . ui . autocomplete . escapeRegex ( value ) + "$" , "i" ) ,
51
+ var value = $ ( element ) . val ( ) . toLowerCase ( ) ,
53
52
valid = false ;
54
53
select . children ( "option" ) . each ( function ( ) {
55
- if ( $ ( this ) . text ( ) . match ( matcher ) ) {
54
+ if ( $ ( this ) . text ( ) . toLowerCase ( ) === value ) {
56
55
this . selected = valid = true ;
57
56
return false ;
58
57
}
86
85
var text = $ ( this ) . text ( ) ;
87
86
if ( this . value && ( ! request . term || matcher . test ( text ) ) )
88
87
return {
89
- label : text . replace (
90
- new RegExp (
91
- "(?![^&;]+;)(?!<[^<>]*)(" +
92
- $ . ui . autocomplete . escapeRegex ( request . term ) +
93
- ")(?![^<>]*>)(?![^&;]+;)" , "gi"
94
- ) , "<strong>$1</strong>" ) ,
88
+ label : text ,
95
89
value : text ,
96
90
option : this
97
91
} ;
111
105
} )
112
106
. addClass ( "ui-widget ui-widget-content ui-corner-left" ) ;
113
107
114
- input . data ( "ui-autocomplete" ) . _renderItem = function ( ul , item ) {
115
- return $ ( "<li>" )
116
- . append ( "<a>" + item . label + "</a>" )
117
- . appendTo ( ul ) ;
118
- } ;
119
-
120
108
$ ( "<a>" )
121
109
. attr ( "tabIndex" , - 1 )
122
110
. attr ( "title" , "Show All Items" )
You can’t perform that action at this time.
0 commit comments