From ee5a06076228a65f69f357d0c3f5aa757201ed9f Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 19 Jul 2021 13:00:29 +0900 Subject: [PATCH] Fix stickyTop calculation --- src/client/directives/sticky-container.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/directives/sticky-container.ts b/src/client/directives/sticky-container.ts index 60b442eba..9610eba4d 100644 --- a/src/client/directives/sticky-container.ts +++ b/src/client/directives/sticky-container.ts @@ -6,7 +6,7 @@ export default { const header = src.children[0]; const currentStickyTop = getComputedStyle(src).getPropertyValue('--stickyTop') || '0px'; - src.style.setProperty('--stickyTop', `${parseInt(currentStickyTop) + header.offsetHeight}px`); + src.style.setProperty('--stickyTop', `calc(${currentStickyTop} + ${header.offsetHeight}px)`); header.style.setProperty('--stickyTop', currentStickyTop); header.style.position = 'sticky'; header.style.top = 'var(--stickyTop)';