Skip to content

Add scrollBehavior to various scrollto functions#21

Open
fourjr wants to merge 3 commits intoRobPethick:masterfrom
fourjr:master
Open

Add scrollBehavior to various scrollto functions#21
fourjr wants to merge 3 commits intoRobPethick:masterfrom
fourjr:master

Conversation

@fourjr
Copy link
Copy Markdown

@fourjr fourjr commented Dec 14, 2021

Adds a scrollBehavior parameter to all scrollToX functions. The parameter accepts 3 values (auto, instant, smooth) (MDN Docs).

This resolves #20 by setting scrollBehavior to smooth.

@fourjr
Copy link
Copy Markdown
Author

fourjr commented Jul 19, 2022

@RobPethick any chance to get this PR merged soon?

@scoelliCollectAI
Copy link
Copy Markdown

@RobPethick ☝️

@megatron-hoa-tp-frontend
Copy link
Copy Markdown

megatron-hoa-tp-frontend commented Sep 21, 2023

While waiting this PR is merged
You guys can use like this

scrollBarRef.current.view.scroll({
  left:30,
  behavior: 'smooth',
});
    
scrollBarRef.current.view.scroll({
  top:30,
  behavior: 'smooth',
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement] Smooth scrolling when calling a "scroll" function

3 participants