Skip to content

Support Pointer events specification #499

Closed

Description

@plievone

What is your approach to IE10 touch events?

Hammer.js checks window.navigator.pointerEnabled || window.navigator.msPointerEnabled and then switches touchstart, touchmove, touchend touchcancel to pointerdown MSPointerDown, pointermove MSPointerMove, pointerup pointercancel MSPointerUp MSPointerCancel.

Activity

  1. shauntrennery commented on Nov 22, 2013

    @shauntrennery
    Contributor

    Any update on this?

  2. sophiebits commented on Nov 22, 2013

    @sophiebits
    Collaborator
  3. jessep commented on Nov 23, 2013

    @jessep

    I would love if they were enabled with a polyfill by default :) Seems like
    a genuine barrier to creating responsive components/apps.

    On Fri, Nov 22, 2013 at 8:45 AM, Ben Alpert [email protected]:

    Maybe we should polyfill pointer events always, like in
    http://blogs.msdn.com/b/eternalcoding/archive/2013/01/16/hand-js-a-polyfill-for-supporting-pointer-events-on-every-browser.aspx.
    Having pointer events always available seems way better than having to
    manage touch and ouse events by hand.

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/499#issuecomment-29087969
    .

  4. petehunt commented on Nov 23, 2013

    @petehunt
    Contributor

    There are issues with listening to touch events always... I forget what they are though. @zpao knows. But we should probably make this work with SimpleEventPlugin and initializeTouchEvents()

  5. sophiebits commented on Nov 23, 2013

    @sophiebits
    Collaborator

    I think we can get rid of initializeTouchEvents if we attach the listeners to the elements which have handlers attached instead of at the document level.

  6. plievone commented on Jan 2, 2014

    @plievone
    ContributorAuthor

    Related: #184

  7. thauburger commented on Feb 5, 2014

    @thauburger
    Contributor

    +1

    It would be cool to have support for pointer events, particularly regarding responsiveness in modern IE / IE mobile browsers. I hate having to add proprietary ms viewport tags / css properties to get rid of the infamous 300ms click delay, for instance.

    Any update here?

  8. chenglou commented on Feb 14, 2014

    @chenglou
    Contributor

    @thauburger edit: there's an internal diff coming up for making onClick work without the delay.

  9. sophiebits commented on Feb 14, 2014

    @sophiebits
    Collaborator

    @chenglou Doesn't work in IE10 right now though, I believe.

  10. thauburger commented on Feb 15, 2014

    @thauburger
    Contributor

    @chenglou @spicyj thanks for the update!

  11. plievone commented on Feb 15, 2014

    @plievone
    ContributorAuthor

    @spicyj For IE10 one can disable click delay with something like

    a, input, button {
        -ms-touch-action: none !important;
    }

    (suggested by fastclick.js)

  12. iamdustan commented on Jul 1, 2014

    @iamdustan
    Contributor
  13. zoomclub commented on Aug 12, 2014

    @zoomclub

    Having to use mouse and touch events separately is not in keeping with the otherwise forward thinking React framework. Pointer Events are the future, what is the status of this issue?

  14. 21 remaining items

  15. MilllerTime commented on Dec 13, 2016

    @MilllerTime

    I wrote a component that allows declarative pointer event binding, and has been working for me as an easy substitute until React officially supports them.

    Update: <Pointable /> now lives in its own repo and is on npm:
    https://www.npmjs.com/package/react-pointable

    While it's great Chrome and FF are shipping pointer events, Safari is my biggest worry. To that end, this component plays well with the official pointer events polyfill project for wide support.

  16. chaffeqa commented on Jan 14, 2017

    @chaffeqa

    I would love to see this... the parody between onPointerEnter and onMouseEnter is sooooo useful for user experiance

  17. anthonybarsotti commented on Mar 16, 2017

    @anthonybarsotti

    @spicyj Is this issue still something we'd want to implement?

  18. philipp-spiess commented on Apr 28, 2017

    @philipp-spiess
    Contributor

    If we don't provide a polyfill and just add support for it in the SimpleEventPlugin, the implementation should be relatively straight-forward, right?

    This will still allow people to use the popular polyfill if they need pointer events on different platforms. React would simply handle this as another type of native events (similar to SyntheticMouseEvent and SyntheticTouchEvent). If this is something you want to implement I'd love to give it a shot 👍

  19. MilllerTime commented on Apr 28, 2017

    @MilllerTime

    @philipp-spiess Even if pointer event support is added to React, integrating with PEP will still require manually setting/removing the touch-action attribute since it's a non-standard workaround required by PEP. Supporting Safari/iOS seems fairly important and touch-action would still be a pain point.

    That being said, if pointer events are added to React, I'll update Pointable so it handles touch-action and allows React to do the rest.

  20. philipp-spiess commented on Apr 28, 2017

    @philipp-spiess
    Contributor

    @MilllerTime Thank you for your input! I agree that the touch-action API is inconvenient. My idea was to simply make React understand pointer events and pool them like touch or mouse events.

    Since support for Safari and iOS is vital, we could write a small guide somewhere as well where we explain how a user can set this up with the polyfill. Either by using your package or adding the touch-action property manually.

    If a more out-of-the-box support for this polyfill is desired, we could also whitelist the touch-action property on HTML elements here.

  21. caub commented on Dec 2, 2017

    @caub

    so React still doesn't support

    <div onPointerDown={console.log}>foo</div>

    the authors don't want it or they are open to a PR?

  22. elijahdorman commented on Mar 13, 2018

    @elijahdorman

    Firefox 59 just shipped with support for pointer events enabled. There's now mainstream support for every browser except Safari.

  23. chaffeqa commented on Mar 13, 2018

    @chaffeqa

    sounds about right 🙄

  24. jquense commented on Mar 13, 2018

    @jquense
    Contributor

    If anyone would like to add support it's pretty straightforward to add native events. Take a look at SimpleEventPlugin and how the other native events are supported.

    There is a question about whether React should polyfill the behave for old browsers, but I think it'll be safe to start with just allowing the native events if anyone wants to give it a shot

  25. added a commit that references this issue on Mar 31, 2018
  26. added a commit that references this issue on Apr 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions