Skip to content

--prod build animation issue #26

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

Closed
madmacc opened this issue Oct 13, 2019 · 6 comments
Closed

--prod build animation issue #26

madmacc opened this issue Oct 13, 2019 · 6 comments

Comments

@madmacc
Copy link

madmacc commented Oct 13, 2019

When I build for development it all works fine.

When I build for production the animation to display all of the items runs twice. The first time a slide in from the bottom and then directly after the images just to the top right and slide in from there. This happens in both chrome and safari.

<ngx-masonry #ngxMasonry [options]="masonryOptions" [updateLayout]="updateMasonryLayout">
  <mat-card ngxMasonryItem *ngFor="let swipeFile of swipeFiles" class="card-swipe-file" (click)="onSwipeFileClick(swipeFile)">
    <div *ngIf="swipeFile.imageUrl" class="linear-background" [ngStyle]="{'width': '300px', 'height': 300 * (swipeFile.imageHeight / swipeFile.imageWidth) + 'px'}" > 
      <img mat-card-image [src]="swipeFile?.imageUrl" alt="image">
    </div>
    
    <mat-card-content>
      <div class="card-title">{{swipeFile?.name}}</div>
      <div class="card-content">{{swipeFile?.description}}</div>
    </mat-card-content>
  </mat-card>
</ngx-masonry>

I am building with --source-map=false for both dev and prod otherwise I get a compilation error.

@wynfred
Copy link
Owner

wynfred commented Oct 14, 2019

The issue should be fixed in the latest angular. What version are you using?

@madmacc
Copy link
Author

madmacc commented Oct 14, 2019

"ngx-masonry": "^1.1.4", (The current latest)
"@angular/animations": "~8.2.5",
"@angular/core": "~8.2.5"

@wynfred
Copy link
Owner

wynfred commented Oct 15, 2019

OK, could you please reproduce it in a repo or stackblitz? I'll take a look at it.

@madmacc
Copy link
Author

madmacc commented Oct 15, 2019

Sure. I could not reproduce on stackblitz as it needs to be built with --prod.
Its my first time adding something to github so let me know if there are any issues.
https://github.com/madmacc/ngxMasonryExample

To reproduce:
ngserve --prod or ngbuild --prod

When the page is first loaded, the refresh button or browser refresh button is clicked it should perform the double animation.

@wynfred
Copy link
Owner

wynfred commented Oct 17, 2019

Seems like although pure_getter was removed, the animation issue is still there. I'm closing this and will reopen the previous issue.
As workaround, you could disable the animation in masonry and add your own angular animation.

@wynfred wynfred closed this as completed Oct 17, 2019
@rozzs74
Copy link

rozzs74 commented Aug 20, 2020

Hi, I am experiencing this issue. My angular version is 6.0.2

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

No branches or pull requests

3 participants