Live data from Hacker News

Pointing the Way Forward

developers.google.com

11–13 of 13 posts

Re: Pointing the Way Forward

#11
> Ever spent a frustrating hour debugging a broken mouseup event, until you realised that it’s because the user is letting go of the button outside your click target? No? Okay, maybe it’s just me, then.

I hope no one uses this example to make an onClick action that works no matter where the pointer is when the button is released. The correct behavior when this happens is to ignore the click when the user has moved off the click target when the button is released. It's a pretty handy convention, as it's the only way to for a user to "abort" a click once they start it - something I've done a few times myself.

This example pattern could be useful, though, in managing the UI state when something like this occurs.

Re: Pointing the Way Forward

#12
post #5
post #2

Finally! 'Pointer events' originated at Microsoft, after the W3C effort to standardize Apple's 'Touch events' became uncertain due to patent issues. For a while, despite admitting it's a more elegant spec for unified input, Google were reluctant to add it because Apple wasn't interested [1][2]. Now Google have changed their mind once more and shipped this, making Apple the only major outlier. The pains of shimming th…

How difficult would a TE -> PE library be to build?

This one has you covered ;)

https://github.com/liftoff/HumanInput

Wrote it myself.

Re: Pointing the Way Forward

#13

> Ever spent a frustrating hour debugging a broken mouseup event, until you realised that it’s because the user is letting go of the button outside your click target? No? Okay, maybe it’s just me, then. I hope no one uses this example to make an onClick action that works no matter where the pointer is when the button is released. The correct behavior when this happens is to ignore the click when the user has moved of…

The problem, as I understand it, is in order for a UI to feel responsive you often have to start reacting to the mousedown/mousemove before the mouseup occurs. So you need to do some cleanup when that mouseup event happens. Only you never got a mouseup event because it happened over some other random element.
Post reply on HN