3 ms·
The Pointer Events spec is a real joy. For example, if you want to roll your own "drag" event for a given element, the API allows you to do this without refere
by jancsika 7y ago
The Pointer Events spec is a real joy.
For example, if you want to roll your own "drag" event for a given element, the API allows you to do this without reference to document or a parent container element. You can just declare that the element currently receiving pointer events capture subsequent pointer events until you release it[1].
Additionally, the API naturally lends itself to patterns that can easily be extended for multi-touch situations.
I'm quite curious which developer led the charge for this API and how they warded off committee meddling by people who lacked knowledge about the benefits of this approach.
[1] https://developer.mozilla.org/en-US/docs/Web/API/Element/setPointerCapture https://developer.mozilla.org/en-US/docs/Web/API/Element/set...