Re: Adding currentTarget to Touch objects

On 05/29/2016 08:36 AM, Kevin Barabash wrote:
> I've been working on implementing an onscreen custom keypad.  If the user presses a key, I want them to be able to move to another key in case they
> made a mistake.  I found it really hard to implement this using Touch Events because a touches are bound to the element that they started on.
>
> I'm using React and was able to patch it to add a 'currentTarget' property to changedTouches, touches, and targetTouches.  The implementation uses
> elementFromPoint.  See https://github.com/facebook/react/pull/6915 for details.
>
So you add currentTarget property to Touch objects, not to the *Touches lists, right?

Anyhow, wouldn't currentTarget be rather hit-testing heavy, so possibly affecting significantly to the responsiveness of the web page
(at least in cases when currentTarget isn't actually needed)?
Given that it is rather easy to use elementFromPoint when needed, I don't see strong reason to add currentTarget.


Have you investigated if pointer events would fit better in your use case?

-Olli



> I'm curious what other people think about adding a currentTarget property.
>
> Kevin Barabash
> Khan Academy
>

Received on Sunday, 29 May 2016 21:35:39 UTC