Skip to content

Commit

Permalink
[tree view][docs] Fix scroll demos disorientation (#13909)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored Jul 22, 2024
1 parent 1f1014a commit 3e0c2fd
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function ApiMethodGetItemDOMElement() {
apiRef.current.focusItem(event, 'charts-community');
apiRef.current
.getItemDOMElement('charts-community')
?.scrollIntoView({ block: 'center' });
?.scrollIntoView({ block: 'nearest' });
};

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function ApiMethodGetItemDOMElement() {
apiRef.current!.focusItem(event, 'charts-community');
apiRef
.current!.getItemDOMElement('charts-community')
?.scrollIntoView({ block: 'center' });
?.scrollIntoView({ block: 'nearest' });
};

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function ApiMethodGetItemDOMElement() {
apiRef.current.focusItem(event, 'charts-community');
apiRef.current
.getItemDOMElement('charts-community')
?.scrollIntoView({ block: 'center' });
?.scrollIntoView({ block: 'nearest' });
};

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function ApiMethodGetItemDOMElement() {
apiRef.current!.focusItem(event, 'charts-community');
apiRef
.current!.getItemDOMElement('charts-community')
?.scrollIntoView({ block: 'center' });
?.scrollIntoView({ block: 'nearest' });
};

return (
Expand Down

0 comments on commit 3e0c2fd

Please sign in to comment.