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

skyhook-preview: binding style template via async pipe causes unnecessary change detection #592

Open
lincolnthree opened this issue Jul 5, 2020 · 1 comment
Labels

Comments

@lincolnthree
Copy link

<div class="firefox-bug" [ngStyle]="style$|async">

Recommend writing directly to the dom and calling change detection manually in or after hover callback:


  constructor(private skyhook: SkyhookDndService, private _el: ElementRef) {
    this.sub = this.style$.subscribe((style) => {
      requestAnimationFrame_or_equivalent(() => {
        this._el.nativeElement.style = `transform: ${style.transform}; display: ${style.display}`;
      });
    });
  }
@keeshii
Copy link

keeshii commented Jul 29, 2020

I confirm the problem, and I've found similar error in the example of the skyhook/sortable. Disabling Ivy seems fixing the issue.

[class.priority--placeholder]="render.isDragging$|async"

            <div class="priority"
                 [ssRender]="context"
                 #render="ssRender"
                 [class.priority--placeholder]="render.isDragging$|async"

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

No branches or pull requests

2 participants