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

How to disable drag for selected elements? #54

Open Nickonimus opened 7 months ago

Nickonimus commented 7 months ago

I have 360egjs viewer inside a container, how can i make to ignore conveyer drag while rotating 360 panorama?

malangfox commented 7 months ago

Hello @Nickonimus.

The feature to ignore a drag gesture for a specific item inside the conveyer is not currently supported. Our team will discuss supporting this feature soon.

Currently, you can implement this by accessing the conveyer's private property conveyer._axes._inputs[0]._enabled. This is not recommended but should be a temporary workaround until we can implement the feature. You can check the demo implementing this feature by private property.

If this feature is supported in a further version, I'll comment further on this issue.

malangfox commented 6 months ago

@Nickonimus

Rather than adding this as a new feature, we recommended using event.stopPropagation to ignore the drag for a specific element in conveyer.

Depending on which mousedown or touchdown event you support, you can implement it like this demo. If you encounter any additional issues implementing this feature, please leave a comment.

Nickonimus commented 6 months ago

@malangfox Thank you! Sorry, forgot to answer at previous reply. Actually i used .stopPropagation and it works well, sometimes happens glitchy jumping but mostly when drag fast or move mouse far away out of panorama. Also will try to make ignore stopPropagation when drag started, and enable only when conveyer stopped.

By the way, is there a way to use wheelScrollable option of view360 together with Conveyer side wheel?