Skip to content

Commit 0467ddd

Browse files
localjojoshuaellis
andauthored
fix(parallax): remove extra targetScroll space (pmndrs#1023)
this was causing some elements to have an extra viewport height gap. see issue for more details. fixes pmndrs#962 Co-authored-by: Josh Ellis <[email protected]>
1 parent 6e6c71e commit 0467ddd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

packages/parallax/src/index.tsx

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

0 commit comments

Comments
 (0)