Fix scroll position when header is visible

This commit is contained in:
toasted-nutbread 2019-12-28 23:03:18 -05:00
parent 0b1bee8c00
commit d4296a34cc

View File

@ -552,6 +552,11 @@ class Display {
target = scroll; target = scroll;
} else { } else {
target = this.index === 0 || entry === null ? 0 : Display.getElementTop(entry); target = this.index === 0 || entry === null ? 0 : Display.getElementTop(entry);
const header = document.querySelector('#navigation-header');
if (header !== null) {
target -= header.getBoundingClientRect().height;
}
} }
if (smooth) { if (smooth) {