Skip to content

Commit d5a1272

Browse files
Merge pull request #58 from C2DH/patch-threshold-NaN
apply min offset when step.state.offsetHeight is NaN
2 parents 5c8a63a + cc38e46 commit d5a1272

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Scrollama.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ class Scrollama extends Component {
210210
const marginBottom = offsetMargin - this.viewH;
211211
const options = {
212212
rootMargin: `${marginTop}px 0px ${marginBottom}px 0px`,
213-
threshold: this.createThreshold(step.state.offsetHeight),
213+
threshold: this.createThreshold(step.state.offsetHeight ?? 1),
214214
};
215215

216216
const obs = new IntersectionObserver(this.intersectStepProgress, options);

0 commit comments

Comments
 (0)