File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1180,7 +1180,9 @@ the specific language governing permissions and limitations under the Apache Lic
11801180
11811181 // abstract
11821182 highlight : function ( index ) {
1183- var choices = this . findHighlightableChoices ( ) ;
1183+ var choices = this . findHighlightableChoices ( ) ,
1184+ choice ,
1185+ data ;
11841186
11851187 if ( arguments . length === 0 ) {
11861188 return indexOf ( choices . filter ( ".select2-highlighted" ) [ 0 ] , choices . get ( ) ) ;
@@ -1191,8 +1193,15 @@ the specific language governing permissions and limitations under the Apache Lic
11911193
11921194 this . results . find ( ".select2-highlighted" ) . removeClass ( "select2-highlighted" ) ;
11931195
1194- $ ( choices [ index ] ) . addClass ( "select2-highlighted" ) ;
1196+ choice = $ ( choices [ index ] ) ;
1197+ choice . addClass ( "select2-highlighted" ) ;
1198+
11951199 this . ensureHighlightVisible ( ) ;
1200+
1201+ data = choice . data ( "select2-data" ) ;
1202+ if ( data ) {
1203+ this . opts . element . trigger ( { type : "highlight" , val : this . id ( data ) , choice : data } ) ;
1204+ }
11961205 } ,
11971206
11981207 // abstract
You can’t perform that action at this time.
0 commit comments