enhance(frontend): improve useScrollPositionKeeper
This commit is contained in:
parent
36989e0cd3
commit
684424f26a
|
@ -22,6 +22,12 @@ export function useScrollPositionKeeper(scrollContainerRef: Ref<HTMLElement | nu
|
||||||
if (!el) return;
|
if (!el) return;
|
||||||
if (!ready) return;
|
if (!ready) return;
|
||||||
|
|
||||||
|
if (el.scrollTop < 100) {
|
||||||
|
// 上部にいるときはanchorを参照するとズレの原因になるし位置復元するメリットも乏しいため設定しない
|
||||||
|
anchorId = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const scrollContainerRect = el.getBoundingClientRect();
|
const scrollContainerRect = el.getBoundingClientRect();
|
||||||
const viewPosition = scrollContainerRect.height / 2;
|
const viewPosition = scrollContainerRect.height / 2;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue