Skip to content

Commit

Permalink
Merge pull request #557 from icflorescu/next
Browse files Browse the repository at this point in the history
Improve scroll example again
  • Loading branch information
icflorescu authored Mar 5, 2024
2 parents 649e2a3 + e8294fa commit 43a0f7e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import { employees } from '~/data';
export function ScrollIntoViewExample() {
// example-start scroll-into-view
const scrollRowIntoView = (selector: string) => {
document.querySelector(selector)?.scrollIntoView(false);
document.querySelector(selector)?.scrollIntoView({ block: 'end', behavior: 'smooth' });
// 👇 if you don't want smooth scrolling, you could simply use this instead:
// document.querySelector(selector)?.scrollIntoView(false);
};

return (
Expand Down

0 comments on commit 43a0f7e

Please sign in to comment.