gm0t / react-sticky-el

MIT License
256 stars 47 forks source link

Behaviour change in v2, null scrollElement causes failure #60

Closed johnhunter closed 4 years ago

johnhunter commented 4 years ago

Prior to version 2.x.x it was possible to trigger stickiness without providing boundaryElement

e.g.

 <Sticky topOffset={0} positionRecheckInterval={10}>
  <h2 className="header">Header</h2>
</Sticky>

Note: scrollElement prop defaults to the window if not provided.

With version 2.0.3 this results in:

The documentation suggests that scrollElement is not a required prop since its default is null. So I'm not clear if this is a regression bug or an intended change to behaviour.

Can we clarify if this an intended breaking change or a bug?

Thanks.

gm0t commented 4 years ago

Yeah, my bad. Fixed in 2.0.4 Thanks a lot for reporting!