Skip to content

Commit 72081e3

Browse files
authored
fix(parallax): revert changes from #1023 (#1440)
1 parent df943c0 commit 72081e3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/parallax/src/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ export const ParallaxLayer = React.memo(
6868
const layer = useMemoOne<IParallaxLayer>(
6969
() => ({
7070
setPosition(height, scrollTop, immediate = false) {
71-
const distance = height * offset
71+
const targetScroll = Math.floor(offset) * height
72+
const distance = height * offset + targetScroll * speed
7273
ctrl.start({
7374
translate: -(scrollTop * speed) + distance,
7475
config: parent.config,

0 commit comments

Comments
 (0)