mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-08-31 17:31:27 +00:00
use smooth scrolling
Tells browser to use smooth scrolling to animate scroll https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo
This commit is contained in:
parent
1698ca8775
commit
599f9e106e
1 changed files with 4 additions and 1 deletions
|
@ -14,7 +14,10 @@ function PublishPage(props: Props) {
|
||||||
function scrollToTop() {
|
function scrollToTop() {
|
||||||
const mainContent = document.querySelector('main');
|
const mainContent = document.querySelector('main');
|
||||||
if (mainContent) {
|
if (mainContent) {
|
||||||
mainContent.scrollTop = 0; // It would be nice to animate this
|
mainContent.scrollTo({
|
||||||
|
top: 0,
|
||||||
|
behavior: 'smooth',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue