mirror of
https://github.com/google/blockly.git
synced 2026-01-06 16:40:07 +01:00
fix: Fix menu scrolling. (#8881)
This commit is contained in:
@@ -258,11 +258,10 @@ export class Menu {
|
||||
// Bring the highlighted item into view. This has no effect if the menu is
|
||||
// not scrollable.
|
||||
const menuElement = this.getElement();
|
||||
const scrollingParent = menuElement?.parentElement;
|
||||
const menuItemElement = item.getElement();
|
||||
if (!scrollingParent || !menuItemElement) return;
|
||||
if (!menuElement || !menuItemElement) return;
|
||||
|
||||
style.scrollIntoContainerView(menuItemElement, scrollingParent);
|
||||
style.scrollIntoContainerView(menuItemElement, menuElement);
|
||||
aria.setState(menuElement, aria.State.ACTIVEDESCENDANT, item.getId());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user