Zecat / iron-auto-scroll

Make it easy to automatically scroll to the selected element.
2 stars 1 forks source link

Question: In <iron-scroll-spy>, you have an element named <iron-auto-scroll-spy>, is this the same? #3

Open oneezy opened 8 years ago

oneezy commented 8 years ago

Sorry for that long title, but I'm curious if <iron-auto-scroll> is basically the same element as your <iron-auto-scroll-spy> dependency for <iron-scroll-spy> ?

(say that 3x fast..haha)

I'm a big fan of <iron-scroll-spy> , So I'm trying to see if and when I might need this element.


Thanks for your contributions to the world of web components!

Zecat commented 7 years ago

Yea there are different elements, <iron-auto-scroll-spy>combines the features of <iron-auto-scroll>and <iron-scroll-spy>.

The architecture is:

<iron-auto-scroll> implement <iron-auto-scroll-behavior>. •<iron-scroll-spy> implement <iron-scroll-spy-behavior>. •<iron-auto-scroll-spy-behavior> implement <iron-auto-scroll-behavior> and <iron-scroll-spy-behavior> with small fix so both work well together. •<iron-auto-scroll-spy> implement <iron-auto-scroll-spy-behavior>

And to resume:

<iron-auto-scroll-behavior> feature is to automatically scroll to an item when selected change. •<iron-scroll-spy-behavior> feature is to update selected when an item reaches the viewport due to a scroll. •<iron-auto-scroll-spy-behavior> combine both and prevent conflicts - disable the spy while auto-scrolling and prevent auto-scroll when selected change due to the spy.

Hope it makes things clearer, doc needs to be improved…