joe223 / tiny-swiper

Ingenious JavaScript Carousel powered by wonderful plugins. Lightweight yet extensible. Import plugins as needed, No more, no less.
https://tiny-swiper.js.org
1.29k stars 58 forks source link

fixed touchmove errors #54

Closed g7alt closed 3 years ago

g7alt commented 3 years ago

fixed errors -> [Intervention] Ignored attempt to cancel a touchmove event with cancelable=false'

g7alt commented 3 years ago

Thanks for the feedback. Here is a good summary I guess https://developers.google.com/web/updates/2017/01/scrolling-intervention.

joe223 commented 3 years ago

Hi @narasab , default behavior should be prevented otherwise page scrolling will coexist with Swiper slide action. Or we have to tackle this problem with different method.

This video shows the concern as mentioned above.

https://user-images.githubusercontent.com/10026019/105037649-4049b300-5a99-11eb-93ea-a5ed3f2abdcc.mp4

checkout this example packages/tiny-swiper/demo/vertical.html

g7alt commented 3 years ago

Yes I see your point. Is there a reason for not using css scroll snap with intersection observer?

joe223 commented 3 years ago

css scroll snap with intersection observer

@narasab That‘s a great idea! You mean create slide effect with scroll snap property sets just like this right?

But what I'm concerned is

Do you have a plan?

g7alt commented 3 years ago

Yes like that one, and use intersection observer to emit the index. But you're right that has to wait for sometime if IE is a concern.

joe223 commented 3 years ago

But we still can fix the touchmove errors, right? Just make sure that e.cancelable is not false @narasab, I'm looking forward your PR

if(state.isTouching && e.cancelable !== false)
g7alt commented 3 years ago

Yes you're right. Checked with the web view and all seems ok.