quando "tappamos" usando um touch device, os seguintes eventos são triggerados

14 Aug 2024

segundo https://web.dev/articles/mobile-touchandmouse sao esses

  1. touchstart
  2. touchmove
  3. touchend
  4. mouseover
  5. mousemove
  6. mousedown
  7. mouseup
  8. click

eu testei aqui no firefox for android (129.0 build #2016035991) e na real foio

  1. touchstart
  2. touchend
  3. mouseover
  4. mousemove
  5. mousedown
  6. mouseup
  7. click

a diferença é a falta do touchmove

se slidar, pra tentar triggerar o touchmove, ai ele só triggeia

  1. touchstart
  2. touchmove (n vezes)
  3. touchend

se clicar e segurar, ele so triggeia

  1. touchstart
  2. mouseover
  3. mousemove
  4. touchend

ai decidi escutar TODOS os eventos, usando https://stackoverflow.com/a/60528233 para lista-los, apareceram uns outros eventos inesperados

  1. pointerover
  2. pointerdown
  3. touchstart
  4. gotpointercapture
  5. pointerup
  6. lostpointercapture
  7. pointerout
  8. touchend
  9. mouseover
  10. mousemove
  11. mousedown
  12. mouseup
  13. click

por curiosidade, tirei a stylus do meu samsung e triggerou

  1. pointerover
  2. pointerdown
  3. touchstart
  4. gotpointercapture
  5. pointermove
  6. touchmove
  7. pointerup
  8. lostpointercapture
  9. pointerout
  10. touchend
  11. mouseover
  12. mousemove
  13. mousedown
  14. mouseup
  15. click

a diferença é um pointermove a mais

um pointer btw, é uma abstração hardware-agnostic pra mouse, stylus, touch etc https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events#pointer_capture

alllllllso brinquei com touch-action scrolling aqui https://patrickhlauke.github.io/touch/touch-action-scrolling/ e nada (tirando pan-x e pan-y) funcionaram da forma q esperava lol

enfim, nada de muito interessante sobre pointer events, dá para usar se precisar de mais controle, mas geralmente os mais alto niveis (tipo click, contextmenu) sao mais que suficientes na maioria dos casos