Skip to content

Commit bc93b3f

Browse files
committed
Menu: Remove the ui-state-active class from the siblings of the newly activated menu item without a delay to fix a bug where mouseover of a menu item directly adjacent to the active item would cause a 1 pixel jump due to both items having a class with a border (ui-state-active and ui-state-focus)
1 parent 7856b26 commit bc93b3f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ui/jquery.ui.menu.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ $.widget( "ui.menu", {
5858
}
5959
var target = $( event.target ).closest( ".ui-menu-item" );
6060
if ( target.length ) {
61+
//Remove ui-state-active class from siblings of the newly focused menu item to avoid a jump caused by adjacent elements both having a class with a border
62+
target.siblings().children( ".ui-state-active" ).removeClass( "ui-state-active" );
6163
self.focus( event, target );
6264
}
6365
})

0 commit comments

Comments
 (0)