DEV Community

Discussion on: Consistent access to browser events with Pointer Events API

Collapse
 
baooab profile image
zhangbao

So, is it better to change the following code like this?

document.addEventListener('touchdown', () => {
  // do something on touchdown
});

// =>

document.addEventListener('touchstart', () => {
  // do something on touchstart
});
Thread Thread
 
pfacklam profile image
Paul Facklam

If you still want to use touch events: yes. But you can also use pointerdown.

Thread Thread
 
baooab profile image
zhangbao

Thanks a lot 🤟