File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -877,11 +877,11 @@ export const MenuBarMixin = (superClass) =>
877
877
// Hide tooltip on mouseover to disabled button
878
878
this . _hideTooltip ( ) ;
879
879
} else if ( button !== this . _expandedButton ) {
880
- const isOpened = this . _subMenu . opened ;
881
- if ( button . item . children && ( this . openOnHover || isOpened ) ) {
880
+ // Switch sub-menu when moving cursor over another button
881
+ // with children, regardless of whether openOnHover is set.
882
+ // If the button has no children, keep the sub-menu opened.
883
+ if ( button . item . children && ( this . openOnHover || this . _subMenu . opened ) ) {
882
884
this . __openSubMenu ( button , false ) ;
883
- } else if ( isOpened ) {
884
- this . _close ( ) ;
885
885
}
886
886
887
887
if ( button === this . _overflow || ( this . openOnHover && button . item . children ) ) {
Original file line number Diff line number Diff line change @@ -525,12 +525,12 @@ describe('open on hover', () => {
525
525
expect ( subMenu . listenOn ) . to . equal ( buttons [ 0 ] ) ;
526
526
} ) ;
527
527
528
- it ( 'should close open sub-menu on mouseover on button without nested items' , async ( ) => {
528
+ it ( 'should not close open sub-menu on mouseover on button without nested items' , async ( ) => {
529
529
fire ( buttons [ 0 ] , openOnHoverEvent ) ;
530
530
await nextRender ( subMenu ) ;
531
531
fire ( buttons [ 1 ] , openOnHoverEvent ) ;
532
532
await nextRender ( subMenu ) ;
533
- expect ( subMenu . opened ) . to . be . false ;
533
+ expect ( subMenu . opened ) . to . be . true ;
534
534
} ) ;
535
535
536
536
it ( 'should switch opened sub-menu on hover also when open-on-hover is false' , async ( ) => {
You can’t perform that action at this time.
0 commit comments