File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1088,7 +1088,7 @@ the specific language governing permissions and limitations under the Apache Lic
10881088 y = child . offset ( ) . top - results . offset ( ) . top ;
10891089
10901090 // make sure the top of the element is visible
1091- if ( y < 0 ) {
1091+ if ( y < 0 && child . css ( 'display' ) != 'none' ) {
10921092 results . scrollTop ( results . scrollTop ( ) + y ) ; // y is negative
10931093 }
10941094 } ,
@@ -2166,12 +2166,14 @@ the specific language governing permissions and limitations under the Apache Lic
21662166 }
21672167 } ) ;
21682168
2169- choices . each2 ( function ( i , choice ) {
2170- if ( ! choice . hasClass ( "select2-disabled" ) && choice . hasClass ( "select2-result-selectable" ) ) {
2171- self . highlight ( 0 ) ;
2172- return false ;
2173- }
2174- } ) ;
2169+ if ( this . highlight ( ) == - 1 ) {
2170+ choices . each2 ( function ( i , choice ) {
2171+ if ( ! choice . hasClass ( "select2-disabled" ) && choice . hasClass ( "select2-result-selectable" ) ) {
2172+ self . highlight ( 0 ) ;
2173+ return false ;
2174+ }
2175+ } ) ;
2176+ }
21752177
21762178 } ,
21772179
You can’t perform that action at this time.
0 commit comments