收藏
回答

"樱花视频在线" Android上canvas滑动到控件外,touchend不触发

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug canvas 客户端 7.0.4 2.6.6

 Android上canvas滑动到控件外,touchend不触发 樱花视频,iPhone上没有问题。


极容易复现


(xml代码)

<view class="container">


<canvas canvas-id="canvasId1" style="width:200prx;height:200prx;background:#222;" bindtouchstart='touch1' bindtouchmove='touch1'bindtouchend='touch1' bindtouchcancel='touch1'>canvas>


<canvas canvas-id="canvasId2" style="width:200prx;height:200prx;background:#f42;margin-top:30rpx" bindtouchstart='touch2'bindtouchmove='touch2' bindtouchend='touch2' bindtouchcancel='touch2'>canvas>

<view>{{msg}}view>


view>


(js代码)


Page({

data: {

msg:""

},

//事件处理函数

touch1: function(e) {

let msg = "canvas1:"+ e. type + " x:"+ parseInt(e. changedTouches[0]. x) + " y:" +parseInt(e. changedTouches[0] 樱花视频免费观看. y).

console.log(msg)

this.showMsg(msg)

},

touch2: function (e) {

let msg = "canvas2:" + e. type + " x:" + parseInt(e. changedTouches[0]. x)+ " y:" + parseInt(e. changedTouches[0] 樱花视频网站. y).

console.log(msg)

this.showMsg(msg)

},


showMsg:function(msg){

this.setData({

msg:msg

})

}

})


最后一次编辑于  2019-04-24
回答关注问题邀请回答
收藏

2 个回答

  • sincere
    sincere
    2019-07-25

    您好,请问解决了吗?


    2019-07-25
    有用
    回复 3
    • 彭学添
      彭学添
      2019-07-30
      没有修复这个bug,但是在外面加一层view,取view的事件和X、Y坐标,可以避免这个情况
      2019-07-30
      回复
    • 安安chin
      安安chin (樱花视频高清)
      2019-08-20回复彭学添
      请教下,您的意思是给canvas加个view包起来,在这个view上绑定事件获取坐标吗?
      2019-08-20
      回复
    • 樱花视频高清 -
      彭学添
      彭学添
      2019-08-20
      没错
      2019-08-20
      回复
  • 疯狂的小辣椒
    疯狂的小辣椒
    2019-04-24

    你好,麻烦提供能复现问题的代码片段(https://developers,weixin,qq,com/miniprogram/dev/devtools/minicode 樱花视频在线,html).

    2019-04-24
    有用
    回复 7
    查看更多(2)
登录 后发表内容