Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update from 2.2.10 to 2.2.12 throws TypeError: Failed to construct 'IntersectionObserver': The provided double value is non-finite. #57

Closed
danieleguido opened this issue Nov 18, 2020 · 1 comment · Fixed by #58

Comments

@danieleguido
Copy link
Contributor

danieleguido commented Nov 18, 2020

Hi, are there any specific updates related to the v2.2.12 ?
I tried to migrate from 2.2.10 to 2.2.12 and my code doesn't work anymore with the prop progress:

             <Scrollama
                  onStepEnter={this.onStepEnter}
                  onStepExit={this.onStepExit}
                  progress
                  onStepProgress={this.onStepProgress}
                  offset={0.42}
                  threshold={0}
                >
@danieleguido
Copy link
Contributor Author

danieleguido commented Nov 18, 2020

Also, the example code is not working, too. Apparently the step state.offsetHeight is null and get updated only after.
I made the example code working by changing threshold options at #L194:

const options = {
         rootMargin: `${marginTop}px 0px ${marginBottom}px 0px`,
-        threshold: this.createThreshold(step.state.offsetHeight),
+        threshold: this.createThreshold(step.state.offsetHeight ?? 1),
       };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant