Skip to content

Commit 5455b93

Browse files
committed
fix scrollIntoView block to nearest
1 parent f77bef1 commit 5455b93

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/MenuItem.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ export class MenuItem extends React.Component<MenuItemProps> {
7878
if (this.node) {
7979
scrollIntoView(this.node, {
8080
scrollMode: 'if-needed',
81+
// eslint-disable-next-line react/no-find-dom-node
8182
boundary: ReactDOM.findDOMNode(parentMenu) as Element,
83+
block: 'nearest',
8284
});
8385
parentMenu[`scrolled-${eventKey}`] = true;
8486
}

0 commit comments

Comments
 (0)