When Mini Program bindtouchend slides to the left, it is removed from the screen and does not trigger.

when Mini Program bindtouchend slides to the left, moving out of the screen does not trigger it, but moving up and down to the right can trigger
wxml

.
<view id="id" class = "ball" bindtouchstart = "handletouchtart" bindtouchmove="handletouchmove" bindtouchend="handletouchend" style = "width : 100%px; height : 40px;">
{{text}}
</view>

wxss

.ball {
  box-shadow:2px 2px 10px -sharpAAA;
  border-radius: 20px;
  position: absolute; 
  left: 50%;
  top: 50%;
 }

js

Page({
 data: {
  lastX: 0,     //x
  lastY: 0,     //y
  text: "",
  currentGesture: 0, //
 },
 //
 handletouchmove: function (event) {
  var currentX = event.touches[0].pageX
  var currentY = event.touches[0].pageY
  var tx = currentX - this.data.lastX
  var ty = currentY - this.data.lastY
  var text = ""
  //
  if (Math.abs(tx) > Math.abs(ty)) {
   if (tx < 0)
    text = ""
   else if (tx > 0)
    text = ""
  }
  //
  else {
   if (ty < 0)
    text = ""
   else if (ty > 0)
    text = ""
  }
 
  //
  this.data.lastX = currentX
  this.data.lastY = currentY
  this.setData({
   text: text,
  });
 },
 
 //
 handletouchtart: function (event) {
  //console.log(this.data.lastX)
  this.data.lastX = event.touches[0].pageX
  this.data.lastY = event.touches[0].pageY
 },
 //
 handletouchend: function (event) {
  console.log(event)
  this.data.currentGesture = 0;
  this.setData({
   text: "",
  });
 },
})
Mar.12,2021

the same problem, mine is also dragging to the left, the bindtouchend is not triggered off the screen, and there is no problem in any other direction, but I tested it on a real machine, and it is normal, but I don't know if you have solved it. If you haven't solved it, it may be that Mini Program's BUG, is not compatible with computer-side testing

.
Menu