Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

thumbnails never are displayed (ng 14) #464

Closed
AlonsoK28 opened this issue Sep 11, 2022 · 4 comments · Fixed by #472
Closed

thumbnails never are displayed (ng 14) #464

AlonsoK28 opened this issue Sep 11, 2022 · 4 comments · Fixed by #472
Labels

Comments

@AlonsoK28
Copy link

AlonsoK28 commented Sep 11, 2022

What is the expected behavior?

ngx-gallery is displayed correctly acoording live demos

What is the current behavior?

thumbnails never are displayed on my project and images has incorrect size

image

What are the steps to reproduce?

actually I use an static set of images (according your basic example https://stackblitz.com/edit/ngx-gallery) to display ngx-gallery component

template.html

        <gallery [items]="images" thumbPosition="left" [dots]="true"></gallery>

component.ts

 getImages() {
    const myImgData = [
      {
        srcUrl: 'https://preview.ibb.co/jrsA6R/img12.jpg',
        previewUrl: 'https://preview.ibb.co/jrsA6R/img12.jpg'
      },
      {
        srcUrl: 'https://preview.ibb.co/kPE1D6/clouds.jpg',
        previewUrl: 'https://preview.ibb.co/kPE1D6/clouds.jpg'
      },
      {
        srcUrl: 'https://preview.ibb.co/mwsA6R/img7.jpg',
        previewUrl: 'https://preview.ibb.co/mwsA6R/img7.jpg'
      },
      {
        srcUrl: 'https://preview.ibb.co/kZGsLm/img8.jpg',
        previewUrl: 'https://preview.ibb.co/kZGsLm/img8.jpg'
      }
    ];

    this.images = myImgData.map(item => new ImageItem({ src: item.srcUrl, thumb: item.previewUrl }));
  }

module.ts

import { GalleryModule } from 'ng-gallery';

imports: [
    // ... other modules ...
    GalleryModule,
    GalleryModule.withConfig({
      // thumbView: 'contain',
    }),

What is the use-case or motivation for changing an existing behavior?

none

Which versions are you using for the following packages?

Angular: 14.2.2
Angular CDK: ^14.2.1
Angular CLI: ~14.2.2
Typescript: ~4.7.2
Gallery: ^7.0.4

Is there anything else we should know?

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 14.2.2
Node: 16.15.0
Package Manager: npm 8.5.5
OS: win32 x64

Angular: 14.2.1
... animations, cdk, common, compiler, compiler-cli, core, forms
... material, platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1402.2
@angular-devkit/build-angular   14.2.2
@angular-devkit/core            14.2.2
@angular-devkit/schematics      14.2.2
@angular/cli                    14.2.2
@angular/fire                   7.4.1
@angular/flex-layout            14.0.0-beta.40
@schematics/angular             14.2.2
rxjs                            7.5.5
typescript                      4.7.3
@MurhafSousli
Copy link
Owner

Please add a stackblitz reproduction!

@AlonsoK28
Copy link
Author

Please add a stackblitz reproduction!

here is an example of this issue https://stackblitz.com/github/AlonsoK28/image-repo-example?file=README.md

@AlonsoK28
Copy link
Author

@MurhafSousli any update of this 😏

@MurhafSousli
Copy link
Owner

MurhafSousli commented Sep 15, 2022

This is a bug when hammerjs is not installed, it was introduced in v7, for now install hammerjs npm i hammerjs then import it in the polyfill.ts import 'hammerjs';

If you don't want to install hammerjs, use ng-gallery@6 by the time we fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants