You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a followup to #188, rather than relying on the old mouse events, we should look forward and switch to using Pointer Events.
These provide a single API that encompasses all kinds of input devices like touch, mouse, and pen/digitizer input. PointerEvents are available on all browsers and platforms that we currently support.
Using PointerEvents should allow us to write a single event handler that works across all supported devices, without worrying about special handling for touch events and the like.
Since the PointerEvents are pretty analogous to MouseEvents, it should be fairly simple to switch over.
Using the media-clip-selector as an example, we could switch from
PointerEvents include a pointerType should we want special handling for mouse vs pen vs touch. For example, this in conjunction with the pointer media query could potentially be used to provide larger touch targets for touch inputs and smaller targets for mouse input on the same device as a user switches how they interact with the page.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
As a followup to #188, rather than relying on the old mouse events, we should look forward and switch to using Pointer Events.
These provide a single API that encompasses all kinds of input devices like touch, mouse, and pen/digitizer input. PointerEvents are available on all browsers and platforms that we currently support.
Using PointerEvents should allow us to write a single event handler that works across all supported devices, without worrying about special handling for touch events and the like.
Since the PointerEvents are pretty analogous to MouseEvents, it should be fairly simple to switch over.
Using the media-clip-selector as an example, we could switch from
media-chrome/src/js/extras/media-clip-selector/index.js
Lines 174 to 180 in 1474d45
to only a single set of event handlers.
PointerEvents include a
pointerType
should we want special handling for mouse vs pen vs touch. For example, this in conjunction with the pointer media query could potentially be used to provide larger touch targets for touch inputs and smaller targets for mouse input on the same device as a user switches how they interact with the page.Due to compatibility with mouse events, there are some limitations on being able to preventDefault some cases however, based on the code, I don't think we'll run into issues.
Beta Was this translation helpful? Give feedback.
All reactions