From c38142dc406f02fb7646d9a40eb52c13e345f5db Mon Sep 17 00:00:00 2001 From: GabrielMeyer Date: Wed, 28 Aug 2019 11:53:23 +0200 Subject: [PATCH] Hotfix for preview on firefox --- .../app/shared/components/preview/preview.component.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/src/app/shared/components/preview/preview.component.ts b/client/src/app/shared/components/preview/preview.component.ts index bdbf1c3d3..6d4ab31f5 100644 --- a/client/src/app/shared/components/preview/preview.component.ts +++ b/client/src/app/shared/components/preview/preview.component.ts @@ -1,4 +1,4 @@ -import { Component, Input } from '@angular/core'; +import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input } from '@angular/core'; import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; import { SearchProperty } from 'app/core/ui-services/search.service'; @@ -8,7 +8,8 @@ import { Searchable } from 'app/site/base/searchable'; @Component({ selector: 'os-preview', templateUrl: './preview.component.html', - styleUrls: ['./preview.component.scss'] + styleUrls: ['./preview.component.scss'], + changeDetection: ChangeDetectionStrategy.OnPush }) export class PreviewComponent { /** @@ -23,6 +24,7 @@ export class PreviewComponent { const representation = model.formatForSearch(); this.formattedSearchValue = representation.properties; this.modelType = representation.type; + this.cd.detectChanges(); } } @@ -46,7 +48,7 @@ export class PreviewComponent { * * @param sanitizer DomSanitizer */ - public constructor(private sanitizer: DomSanitizer) {} + public constructor(private sanitizer: DomSanitizer, private cd: ChangeDetectorRef) {} /** * Function to sanitize any text to show html.