While working on stylus support I've noticed that events from stylus are being sent twice. This is because pen also sends TouchEvents. Our code has the following check:
if (event.changedTouches[i].touchType === 'stylus') {
continue;
}
Given that TouchEvents that we send to handlers are constructed manually from data taken from PointerTracker (see this function) I think it is better to remove TouchEventManager than trying to find some weird ways to block it from sending stylus events.
Description
While working on
stylus
support I've noticed that events fromstylus
are being sent twice. This is becausepen
also sendsTouchEvents
. Our code has the following check:The problem with this approach is that
touchType
is only supported on mobile Safari.Given that
TouchEvents
that we send to handlers are constructed manually from data taken fromPointerTracker
(see this function) I think it is better to removeTouchEventManager
than trying to find some weird ways to block it from sendingstylus
events.Test plan
Verified that our examples work as they should