MurhafSousli / ngx-gallery

Angular Gallery, Carousel and Lightbox
https://ngx-gallery.netlify.app/
MIT License
610 stars 129 forks source link

Swipes do not work after updating from Angular 6 to Angular 9 #328

Closed Nervniyak closed 4 years ago

Nervniyak commented 4 years ago

Horizontal swipes from image to image stopped working after upgrading angular, it was working before, I installed hammerjs of version 2.0.8 and imported HammerModule to App.module, but it still doesn't work.

I use gallery like this <gallery *ngIf="multipleImages" [items]="multipleImages" [counter]="false"></gallery>

      this.multipleImages = data.map(i => {
        return new ImageItem({ src: i, thumb: i});
      });

Angular: 9.0.6 Angular CDK: 9.1.3 Angular CLI: 9.06 Typescript: 3.7.5 Gallery: 5.0.0-beta.0

MurhafSousli commented 4 years ago

HammerModule is not required for this library, it does not use it!

You still have to import hammerjs yourself as mentioned in the docs https://angular.io/api/platform-browser/HammerModule

Nervniyak commented 4 years ago

Angular migration deleted the import from code :( import 'hammerjs'; Introducing it back fixed the issue, thanks.