components icon indicating copy to clipboard operation
components copied to clipboard

Add guide for adding gestures to components

Open jelbourn opened this issue 5 years ago • 2 comments

With Angular v9, we removed direct gesture handling in Angular Material. We did this for a number of reasons, including:

  • Drop dependency on mostly unmaintained HammerJS
  • Give people flexibility to use other gesture solutions
  • No requirement to add gesture code for users that don't actually want it
  • Simplify project setup

However, we should still have a guide that explains how to add gestures for users that want them. The guide should cover topics including:

  • Swiping out a sidenav
  • Swiping between tabs
  • Swiping items away on a list / table
  • Swiping calendar months

Related to #2209

jelbourn avatar May 27 '20 20:05 jelbourn

Not sure if it's the best place to post this, but since #2209 is closed...

I just released a small library to handle common gestures on tabs :

  • Scroll tab header with your finger IF there are too much tabs to show it all on your screen
  • Swipe between tabs by swiping the tab content from left to right (or right to left)

https://www.npmjs.com/package/@angular-material-gesture/mat-tab-group-gesture

Feel free to use it and give me some feedback if you encounter any issue!

Gaiidenn avatar May 02 '21 22:05 Gaiidenn

Any updates here?

kkachniarz220 avatar May 07 '25 12:05 kkachniarz220

Maybe it's time? When hammerjs is deprecated in Angular 20.

xstor1 avatar Jul 11 '25 20:07 xstor1