gm0t / react-sticky-el

MIT License
251 stars 47 forks source link

Add resize listener to boundary element #12

Closed mitas1 closed 4 years ago

mitas1 commented 7 years ago

This change fixes a problem when the sticky element width does not change after resizing the boundary element. When dimensions of boundary element change, checkPosition() was not fired, what causes that width of the sticky element does not change. After mounting the boundary element, resize listener should be registered and fire checkPosition() on resize, which should update dimensions.

I have also updated package.json, because lib is ignored and I need to install it from our repo.

gm0t commented 7 years ago

Hi @mitas1, Thank you for your PR! Sorry for my late reply, I've been very busy :(

1) I don't understand your problem with lib folder, dist folder should be used only for example. Could you please describe your problem with current lib/sticky.js?

2) As for resize problem, it's wrong to listen for boundaryElement, since in fact we should react to holder size change, what do you think?