FIX: --header-offset didn't account for overscroll (#15221)
Fixes miniprofiler badge sliding away from the header when you rubber-band overscroll on the top of the page (in Safari)
This commit is contained in:
parent
f26b8b448d
commit
301d5657fe
|
@ -183,9 +183,13 @@ const SiteHeaderComponent = MountWidget.extend(
|
||||||
}
|
}
|
||||||
|
|
||||||
const offset = info.offset();
|
const offset = info.offset();
|
||||||
const headerRect = header.getBoundingClientRect(),
|
const headerRect = header.getBoundingClientRect();
|
||||||
headerOffset = headerRect.top + headerRect.height,
|
const doc = document.documentElement;
|
||||||
doc = document.documentElement;
|
let headerOffset = headerRect.top + headerRect.height;
|
||||||
|
|
||||||
|
if (window.scrollY < 0) {
|
||||||
|
headerOffset -= window.scrollY;
|
||||||
|
}
|
||||||
|
|
||||||
const newValue = `${headerOffset}px`;
|
const newValue = `${headerOffset}px`;
|
||||||
if (newValue !== this.currentHeaderOffsetValue) {
|
if (newValue !== this.currentHeaderOffsetValue) {
|
||||||
|
|
Loading…
Reference in New Issue