fancybox icon indicating copy to clipboard operation
fancybox copied to clipboard

HTML div scrolling with enabled touch

Open Mangatt opened this issue 6 years ago • 4 comments

Hello, is there a way how to keep div with overflow:auto scrollable with touch gestures enabled? I've spent couple of hours on this issue and I'm not sure if that's even possible.

My idea is that dragging inside of that div would cause normal scrolling of it's contents while dragging outside would enable normal touch gestures.

Thanks

Mangatt avatar Feb 19 '20 06:02 Mangatt

Hi,

Have you tried adding data-selectable="true" attribute to your html element?

fancyapps avatar Feb 19 '20 19:02 fancyapps

Yes, I've tried that, but UX is actually worse than touch:{vertical:false,momentum:true}.

Ideally, horizontal gestures should work as usual and vertical only after container is scrolled fully in either direction. Or keep behavior of data-selectable="true" only for vertical gestures and allow horizontal gestures to work normally.

Mangatt avatar Feb 20 '20 08:02 Mangatt

If I understand you correctly, users would not be able to select any text inside your scrolling div, is that OK with you?

fancyapps avatar Feb 20 '20 19:02 fancyapps

Yes, no selection at all. Just to keep enabled both gestures and scrolling inside overflowing div.

Mangatt avatar Feb 21 '20 14:02 Mangatt