白羽
白羽
  • 发布:2019-09-23 19:12
  • 更新:2019-09-23 19:12
  • 阅读:889

【报Bug】nvue的touchancel事件的pageY和screenY坐标错误

分类:nvue

我创建了一个非全屏的nvue页面,用作popup型subNVue原生子窗体使用,结果发现:

touchstart、touchmove、touchend事件的坐标都是正确的;而touchcancel事件的坐标是错误的——它似乎是以主调页面为坐标参考,而不是以当前的subNVue页面为坐标参考

页面结构

  • 在index.vue页面中,调用了一个"popup"型底部subNVue原生子窗体——keybord.nvue。
  • 在subNVue原生子窗体的某个元素中,同时添加touchstart、touchmove、touchend,以及touchcancel事件。
  • 在以上的每个事件处理程序中,console.log(JSON.stringfy(event))。
  • 长按该元素(适当移动手指),依次出现touchstart、touchmove、touchend等事件,控制台打印出来的event均是正确的,**其坐标均相对于当前的keybord.nvue页面。
  • 但在长按该元素的同时,如果触发了touchcancel事件(比如,通过另一个向调试手机拨打电话、微信视频等),该事件的event详情中的pageY和screenY坐标均是错误的,比touchstart、touchmove、touchend等事件event详情中的pageY和screenY坐标大444.5(不同的手机,该值不同),touchcancel事件event详情中的pageX/pageY和screenX/screenY坐标,似乎是以index.vue页面为参考,而非以keybord.nvue页面为参考

以下是pages.json配置

    "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages  
        {  
            "path": "pages/index/index",  
            "style": {  
                "navigationBarTitleText": "uni-app",  
                "app-plus": {  
                    "subNVues": [{  
                        "id": "keybord",  
                        "path": "keybord/keybord",  
                        "type": "popup",  
                        "style": {  
                            "height": "550upx",  
                            "bottom": "0",  
                            "mask": "none"  
                        }  
                    }]  
                }  
            }  
        }, {  
            "path": "keybord/keybord",  
            "style": {}  
        }  
    ],  
        ......
2019-09-23 19:12 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复