mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-12-28 07:50:32 +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;
|
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(() => {
|
setTimeout(() => {
|
||||||
const id = hash.replace('#', '');
|
const id = hash.replace('#', '');
|
||||||
const el = id ? document.getElementById(id) : null;
|
const el = id ? document.getElementById(id) : null;
|
||||||
const viewPort = document.getElementById('view-port');
|
const viewPort = document.body;
|
||||||
|
|
||||||
if (!viewPort) {
|
if (!viewPort) {
|
||||||
console.log('Can not find viewPort element');
|
console.log('Can not find viewPort element');
|
||||||
|
Loading…
Reference in New Issue
Block a user