File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -36,4 +36,17 @@ var highlight = function($element, pattern) {
3636 return $element . each ( function ( ) {
3737 highlight ( this ) ;
3838 } ) ;
39- } ;
39+ } ;
40+
41+ /**
42+ * removeHighlight fn copied from highlight v5 and
43+ * edited to remove with() and pass js strict mode
44+ */
45+ jQuery . fn . removeHighlight = function ( ) {
46+ return this . find ( "span.highlight" ) . each ( function ( ) {
47+ this . parentNode . firstChild . nodeName ;
48+ var parent = this . parentNode ;
49+ parent . replaceChild ( this . firstChild , this ) ;
50+ parent . normalize ( ) ;
51+ } ) . end ( ) ;
52+ } ;
Original file line number Diff line number Diff line change @@ -1100,6 +1100,7 @@ $.extend(Selectize.prototype, {
11001100
11011101 // highlight matching terms inline
11021102 if ( self . settings . highlight && results . query . length && results . tokens . length ) {
1103+ $dropdown_content . removeHighlight ( ) ;
11031104 for ( i = 0 , n = results . tokens . length ; i < n ; i ++ ) {
11041105 highlight ( $dropdown_content , results . tokens [ i ] . regex ) ;
11051106 }
You can’t perform that action at this time.
0 commit comments