From 7b27273d96d1ed17e5fea536509e247b96e3c071 Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Mon, 29 Aug 2022 13:01:21 +0300 Subject: [PATCH] RED-4819: Update scrollableParentView only when helpModeKey changes --- .../expandable-file-actions.component.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/red-ui/src/app/modules/shared/components/expandable-file-actions/expandable-file-actions.component.ts b/apps/red-ui/src/app/modules/shared/components/expandable-file-actions/expandable-file-actions.component.ts index 1f0dbd2b0..40f9f3122 100644 --- a/apps/red-ui/src/app/modules/shared/components/expandable-file-actions/expandable-file-actions.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/expandable-file-actions/expandable-file-actions.component.ts @@ -23,6 +23,7 @@ export class ExpandableFileActionsComponent implements OnChanges { displayedButtons: Action[]; hiddenButtons: Action[]; expanded = false; + scrollableParentView: ScrollableParentView; constructor( private readonly _fileDownloadService: FileDownloadService, @@ -30,10 +31,6 @@ export class ExpandableFileActionsComponent implements OnChanges { private readonly _permissionsService: PermissionsService, ) {} - get scrollableParentView(): ScrollableParentView { - return this.helpModeKey === 'document_features_in_dossier' ? ScrollableParentViews.VIRTUAL_SCROLL : undefined; - } - ngOnChanges(changes: SimpleChanges) { if (changes.actions || changes.maxWidth || changes.minWidth) { let count = 0; @@ -69,6 +66,11 @@ export class ExpandableFileActionsComponent implements OnChanges { downloadBtn.disabled = !this._permissionsService.canDownloadFiles(downloadBtn.files, downloadBtn.dossier); } } + + if (changes.helpModeKey) { + this.scrollableParentView = + this.helpModeKey === 'document_features_in_dossier' ? ScrollableParentViews.VIRTUAL_SCROLL : undefined; + } } private async _downloadFiles($event: MouseEvent, files: File[]) {