Chrome encounters onmousedown,onmousemove failure?

The

code is written in react. The problem is this:
1, chrome, mouse down-> move. The code that triggers ontouchstart, but does not trigger ontouchmove
is as follows: who knows what the problem may be?

handleDownTest(){
    console.log("handleDownTest")
    let target = document.querySelector(`-sharptest1`)
    target.ontouchmove = this.handlemovetest.bind(this,target )
    target.ontouchup = this.handleuptest.bind(this)
  }

  handlemovetest(target ){
    console.log("handlemovetest")
    target.style.color = "red";
  }

  handleuptest(target ){
    console.log("handleuptest")
    target.onmousemove = null
    target.onmouseup = null
  }
render() {
    const { value } = this.props

    return (
      <div id="test1" onTouchStart={this.handleDownTest.bind(this)}>
        qwqwqwqwqw
      </div>
    )
  }
}
Nov.12,2021

this situation is probably due to the inconsistent concept of the browser's interpretation of events. It is possible that chrome believes that onmousedown is simply pressing, and if you press and move, it is not just onmousedown , / squint, let me look for information.

< hr >

can you use https://runjs.cn/code to write your code;


you need to use target.addEventListener ('touchmove',func) in chrome to

Menu