mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-12-27 15:30:37 +05:30
#237: fix scrollTo viewport element
This commit is contained in:
parent
b328f7ba92
commit
c8c8f5eb6d
@ -31,7 +31,13 @@ export default function scrollTo(y, viewPort) {
|
||||
return;
|
||||
}
|
||||
|
||||
viewPort.scrollTop = y + delta;
|
||||
const newScrollTop = y + delta;
|
||||
viewPort.scrollTop = newScrollTop;
|
||||
|
||||
if (viewPort.scrollTop === 0) {
|
||||
scrollWasTouched = true;
|
||||
console.warn('The viewPort is not scrollable', viewPort);
|
||||
}
|
||||
}());
|
||||
});
|
||||
|
||||
|
@ -73,7 +73,7 @@ function restoreScroll() {
|
||||
setTimeout(() => {
|
||||
const id = hash.replace('#', '');
|
||||
const el = id ? document.getElementById(id) : null;
|
||||
const viewPort = document.getElementById('view-port');
|
||||
const viewPort = document.body;
|
||||
|
||||
if (!viewPort) {
|
||||
console.log('Can not find viewPort element');
|
||||
|
Loading…
Reference in New Issue
Block a user