@momentum-design/components 0.133.35 → 0.133.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -402,7 +402,8 @@ class MenuPopover extends Popover {
|
|
|
402
402
|
if (this.menuItems.length > 0) {
|
|
403
403
|
this.menuItems.forEach(menuitem => menuitem.setAttribute('tabindex', '-1'));
|
|
404
404
|
this.menuItems[currentIndex].setAttribute('tabindex', '0');
|
|
405
|
-
this.menuItems[currentIndex].focus();
|
|
405
|
+
this.menuItems[currentIndex].focus({ preventScroll: true });
|
|
406
|
+
this.menuItems[currentIndex].scrollIntoView({ block: 'nearest' });
|
|
406
407
|
}
|
|
407
408
|
}
|
|
408
409
|
/**
|
|
@@ -424,7 +425,8 @@ class MenuPopover extends Popover {
|
|
|
424
425
|
return;
|
|
425
426
|
this.menuItems[oldIndex].setAttribute('tabindex', '-1');
|
|
426
427
|
this.menuItems[newIndex].setAttribute('tabindex', '0');
|
|
427
|
-
this.menuItems[newIndex].focus();
|
|
428
|
+
this.menuItems[newIndex].focus({ preventScroll: true });
|
|
429
|
+
this.menuItems[newIndex].scrollIntoView({ block: 'nearest' });
|
|
428
430
|
}
|
|
429
431
|
/**
|
|
430
432
|
* Closes all menu popovers in the stack.
|