eddiemf / vue-affix

A Vue.js plugin that affixes an element on the window while scrolling based on a relative element
MIT License
405 stars 38 forks source link

Changing offset with computed property causes incorrect position #49

Open geoffreyrichey opened 5 years ago

geoffreyrichey commented 5 years ago

Might be related to #29 - but I have the following issue:

<Affix ... :offset="computedOffset">...

Where computedOffset changes based on different window sizes. The affixed positioning is off if the value changes. From what I can see it's caused by the 'topPadding' getting initialized once when the component is mounted but not updated if the offset changes.