简体   繁体   English

jquery-ui可拖动干扰触摸滚动

[英]jquery-ui draggable interfering with touch scroll

It's my understanding that jQuery UI totally ignores touch events and people wanting to use touch events have had to use touch-punch to map touch events into mouse events. 据我了解,jQuery UI完全忽略了触摸事件,而想要使用触摸事件的人们不得不使用触摸打孔将触摸事件映射为鼠标事件。 However, the newer versions of UI seem to be interfering with built in touch events such as scrolling even though they should be ignoring those events. 但是,较新版本的UI似乎会干扰内置的触摸事件,例如滚动,即使它们应该忽略这些事件也是如此。

I have jQuery UI draggable elements that work fine. 我有运行良好的jQuery UI draggable元素。 However, when using a touch device and attempting to scroll the window with that element below the touch point, the screen won't scroll. 但是,当使用触摸设备并尝试滚动该元素位于触摸点下方的窗口时,屏幕将不会滚动。 If jQuery UI is ignoring touch events, why is this happening? 如果jQuery UI忽略触摸事件,为什么会发生这种情况?

I've found that older versions of UI don't have this issue. 我发现旧版的UI没有这个问题。 The version I'm using is 1.11.4 . 我使用的版本是1.11.4。

Just to re-iterate: I'm not trying to make the draggable elements draggable on a touch device. 重申一下:我并不是要使draggable元素在触摸设备上draggable拖动。 I just want it to ignore the touch events and allow regular scrolling to happen. 我只希望它忽略触摸事件并允许定期滚动发生。

似乎该库忽略了动作,但是CSS设置了touch-action: none正是导致我看到的功能的原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM