File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -482,8 +482,6 @@ $.widget( "ui.autocomplete", {
482482 . empty ( )
483483 . zIndex ( this . element . zIndex ( ) + 1 ) ;
484484 this . _renderMenu ( ul , items ) ;
485- // TODO refresh should check if the active item is still in the dom, removing the need for a manual blur
486- this . menu . blur ( ) ;
487485 this . menu . refresh ( ) ;
488486
489487 // size and position menu
Original file line number Diff line number Diff line change @@ -319,6 +319,11 @@ $.widget( "ui.menu", {
319319 . prepend ( submenuCarat ) ;
320320 menu . attr ( "aria-labelledby" , item . attr ( "id" ) ) ;
321321 } ) ;
322+
323+ // If the active item has been removed, blur the menu
324+ if ( this . active && ! $ . contains ( this . element [ 0 ] , this . active [ 0 ] ) ) {
325+ this . blur ( ) ;
326+ }
322327 } ,
323328
324329 _itemRole : function ( ) {
You can’t perform that action at this time.
0 commit comments