naver / egjs-conveyer

Conveyer adds Drag gestures to your Native Scroll.
https://naver.github.io/egjs-conveyer/
MIT License
111 stars 8 forks source link

feat: add nested option #11

Closed malangfox closed 2 years ago

malangfox commented 2 years ago

Details

Added nested to ConveyerOptions. If nested is true, The parent component moves in the same direction after the Conveyer reaches the first/last scroll position. You can use any parent component which have same direction with Conveyer, such as Conveyer itself or Flicking.

nestedconv

In Conveyer, circular in AxesOption is true, so implementation using the nested option of Axes was not suitable. However, I implemented it in a way that disables the property that prevents event propagation in Axes according to the scroll state of the Conveyer.

Also this is the part I am still thinking about - Is there a better way to understand the description of the nested option?

When only Flicking component have nested option, there was only an example of Flicking placed inside Flicking. However, the nested option between multiple components is now compatible with each other as they determine whether events are spread to the parent component.

I wish there was a way to make this easier to understand.