Skip to content

Commit

Permalink
[tree view][docs] Fix scroll demos disorientation
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Jul 20, 2024
1 parent 3f60add commit 095e98b
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 095e98b

Please sign in to comment.