Remove the need of a 'touch-action' attribute on DOM nodes to fire pointer events #92
Comments
I think the problem is that on current browsers not implementing pointer events there is no reliable cross-browser way to determine whether |
@dmethvin My question was more about requiring touch-action as an attribute to even start firing pointer events. According to the specification, should not the pointer events be fired even if I do not have the CSS property set? By default, the value of touch-action is auto. |
There is a perf trade off here due to the perf impact on threaded scrollimg On of the big benefits of implementing touch action natively is that it can
|
I've been working a lot recently to remove this. With #90, For touch, the simulated mouse events can provide enough information for down and up, but they will have the wrong pointerType. Like what @RByers said, touch handlers have a very big performance tradeoff that I've been trying to keep minimal. |
How about requiring the attribute to opt-in only for touchmove events ? Apart from having to treat touchmove as a special case, can the need to opt-in for other touch events be removed ? |
Touchstart is an issue too - prevents scroll from starting, especially an But yes with native support for touch-action, this restriction can be
|
Does touchstart have that bad a performance impact ? If not, we would just need the touch-action DOM attribute only for touchmove and all other pointer events will work without needing the attribute (like in the specification). I also noticed that in touch.js, there is a check for the support of a touch-action CSS style. The if-else state basically says that if touch-action CSS style is supported by the browser, all touch event listeners are added to the top level document. If the CSS style is not supported, these events are added to sub-trees based on the touch-action attribute on the subtree DOM. |
I'll answer your two part question in two parts:
Yes, if [touch-action="none"] {
-ms-touch-action: none;
touch-action: none;
} |
As it is likely related, it seems you cannot listen to PointerEvents from |
@bergie I'm not sure I understand what you mean. All PointerEvents bubble from their target to the window. From the issue you linked, it seems your problem is actually related to events that target I'll file a new bug, as this one is incredibly stale. |
The W3C specification does not require a touch-action attribute in a DOM node to fire pointer events.
Is this requirement for performance - and not having to add event listeners to all DOM nodes ?
The text was updated successfully, but these errors were encountered: