angular-svg-icon icon indicating copy to clipboard operation
angular-svg-icon copied to clipboard

Style not applied to element due to not detected changes

Open Adam-Michalski opened this issue 5 years ago • 1 comments

I am facing problem where svgStyle does not apply to element (sometimes) in cause of setSvg called after changes of name and no setStyle called from SvgIconComponent.

My case is that I am loading screen with empty icon status, then I update that status to proper icon. When I debug this code then everything goes fine until last step (everything is set as expected style is set before last step), the last step resets all svg elements to initial without setting style property. Changes are reset in this.destroy() and in below code changes points to null

      const changes = this.differ.diff(this._svgStyle);
      console.log('differences', changes);

2

workaround for now is to set svg style manualy with ::ng-deep

  .status-new {
    color: #5f6c84;

    svg {
      width: 16px;
    }
  }

Adam-Michalski avatar Feb 21 '20 07:02 Adam-Michalski

@Adam-Michalski - Could you provide a small example of the typescript and html code to reproduce this?

czeckd avatar Feb 25 '20 16:02 czeckd