Skip to content

Commit cc38e46

Browse files
committed
apply min offset when step.state.offsetHeight is NaN
1 parent 5c8a63a commit cc38e46

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)