reason-react icon indicating copy to clipboard operation
reason-react copied to clipboard

Implement React's Pointer Events

Open nickretallack opened this issue 5 years ago • 6 comments

React supports Pointer Events now. It works in Chrome, Firefox, and IE/Edge. You have to bring your own polyfill for Safari but there are some mature ones.

Unfortunately, even if I include the polyfill, I can't just set onPointerDown events on my ReasonReact DOM elements as the type system considers it an error. Could we change this? And also add the custom attributes required by PEP? Is there a way for me to extend what attributes are allowed on a DOM element in order to support this myself? Should I be using cloneElement as an escape hatch?

nickretallack avatar Jul 08 '18 00:07 nickretallack

For the sake of cleaning up the repo (and given how old this issue is) I'm going to close this out.

Please re-open if this is still relevant. Thanks!

peterpme avatar Apr 22 '20 21:04 peterpme

I haven't checked recently. Did this ever get implemented?

nickretallack avatar May 02 '20 07:05 nickretallack

Nope! Thanks for bringing this up. I'd love your help in starting a PR for this if you have insight on pointer events :smile:

peterpme avatar May 03 '20 20:05 peterpme

Here's the PR I wrote 2 years ago attempting to add this to my local setup: https://github.com/reasonml/reason-react/pull/581. Ultimately I didn't use it though. Maybe someone else can make sense of this?

nickretallack avatar May 19 '20 06:05 nickretallack

Ok, I'm working on a proper change, but... it would be nice if ReactEvent.re(i) followed the inheritance structure for event types instead of just repeating their fields over and over. Is that possible? I'll ask on discord for help with this tomorrow.

nickretallack avatar May 19 '20 07:05 nickretallack

The new PR: https://github.com/reasonml/reason-react/pull/584

nickretallack avatar May 20 '20 03:05 nickretallack