You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by GitBox <gi...@apache.org> on 2018/11/28 09:25:10 UTC

[GitHub] yaowei9363 commented on issue #9301: 关于在桌面环境下对滑动事件的支持/About support for sliding events in the desktop environment

yaowei9363 commented on issue #9301: 关于在桌面环境下对滑动事件的支持/About support for sliding events in the desktop environment
URL: https://github.com/apache/incubator-echarts/issues/9301#issuecomment-442378058
 
 
   > > 戴尔24寸触摸屏触屏上是否任何触摸都没有响应?
   > > (抱歉暂时没有这个设备来测试,只能猜测一下问题)
   > 
   > 只有图表canvas没有响应滑动事件,点击事件可以触发,
   > 网页body本身响应滑动和点击事件
   > 使用chrome的改变为移动设备功能后,所有功能正常使用,包括滑动等
   > 已经确定, 在pc端渲染下不会支持触屏操作, touch操作只是被识别为click事件, 请问有什么办法可以强制被识别为移动端渲染
   > 
   > 已经解决问题
   > 原因: zepto的detect判别方法并不完善
   > 
   > ```js
   >     return {
   >         browser: browser,
   >         os: os,
   >         node: false,
   >         // 原生canvas支持,改极端点了
   >         // canvasSupported : !(browser.ie && parseFloat(browser.version) < 9)
   >         canvasSupported: !!document.createElement('canvas').getContext,
   >         svgSupported: typeof SVGRect !== 'undefined',
   >         // works on most browsers
   >         // IE10/11 does not support touch event, and MS Edge supports them but not by
   >         // default, so we dont check navigator.maxTouchPoints for them here.
   > 
   >        //这里的'ontouchstart' in window 对于触屏显示器返回的依然是flase
   >         touchEventsSupported: 'ontouchstart' in window && !browser.ie && !browser.edge,
   >         // <http://caniuse.com/#search=pointer%20event>.
   >         pointerEventsSupported: 'onpointerdown' in window
   >             // Firefox supports pointer but not by default, only MS browsers are reliable on pointer
   >             // events currently. So we dont use that on other browsers unless tested sufficiently.
   >             // Although IE 10 supports pointer event, it use old style and is different from the
   >             // standard. So we exclude that. (IE 10 is hardly used on touch device)
   >             && (browser.edge || (browser.ie && browser.version >= 11))
   >         // passiveSupported: detectPassiveSupport()
   >     };
   > }
   > ```
   > 
   > 解决方式:
   > 因为生产环境固定为触屏显示器, 同时依然对鼠标事件有一定支持, 直接在这里设置固定值为true
   > 
   > 解决思路:
   > 更改挂载思路, 可以手动选择是否渲染移动端touch等事件
   
   我和您遇到同样的问题了,请问zepto 只需要以上的配置就可以了吗

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@echarts.apache.org
For additional commands, e-mail: dev-help@echarts.apache.org