AAE-28655 Fix for datatable not scrolling back up after paginations

This commit is contained in:
Alex Molodyh 2025-01-31 10:16:27 -08:00
parent 0c459227a8
commit 971fde213a
No known key found for this signature in database
GPG Key ID: 64B4F1C7AEE95C47

View File

@ -174,12 +174,13 @@
</div> </div>
<div <div
*ngIf="!loading"
class="adf-datatable-body" class="adf-datatable-body"
[ngClass]="{ 'adf-blur-datatable-body': blurOnResize && (isDraggingHeaderColumn || isResizing), 'adf-datatable-body__draggable': enableDragRows && !isDraggingRow, 'adf-datatable-body__dragging': isDraggingRow }" [ngClass]="{ 'adf-blur-datatable-body': blurOnResize && (isDraggingHeaderColumn || isResizing), 'adf-datatable-body__draggable': enableDragRows && !isDraggingRow, 'adf-datatable-body__dragging': isDraggingRow }"
cdkDropList cdkDropList
[cdkDropListDisabled]="!enableDragRows" [cdkDropListDisabled]="!enableDragRows"
role="rowgroup"> role="rowgroup">
<ng-container *ngIf="!loading && !noPermission"> <ng-container *ngIf="!noPermission">
<adf-datatable-row *ngFor="let row of data.getRows(); let idx = index" <adf-datatable-row *ngFor="let row of data.getRows(); let idx = index"
cdkDrag cdkDrag
[cdkDragDisabled]="!enableDragRows" [cdkDragDisabled]="!enableDragRows"
@ -200,8 +201,8 @@
(contextmenu)="markRowAsContextMenuSource(row)"> (contextmenu)="markRowAsContextMenuSource(row)">
<!-- Drag button --> <!-- Drag button -->
<div *ngIf="enableDragRows" <div *ngIf="enableDragRows"
role="gridcell" role="gridcell"
class="adf-datatable-cell adf-datatable__actions-cell adf-datatable-hover-only"> class="adf-datatable-cell adf-datatable__actions-cell adf-datatable-hover-only">
<button mat-icon-button <button mat-icon-button
[attr.aria-label]="'ADF-DATATABLE.ACCESSIBILITY.DRAG' | translate"> [attr.aria-label]="'ADF-DATATABLE.ACCESSIBILITY.DRAG' | translate">
<mat-icon>drag_indicator</mat-icon> <mat-icon>drag_indicator</mat-icon>
@ -229,11 +230,11 @@
</div> </div>
<label *ngIf="multiselect" <label *ngIf="multiselect"
(keydown.enter)="onEnterKeyPressed(row, $any($event))" (keydown.enter)="onEnterKeyPressed(row, $any($event))"
(click)="onCheckboxLabelClick(row, $event)" (click)="onCheckboxLabelClick(row, $event)"
[for]="'select-file-' + idx" [for]="'select-file-' + idx"
class="adf-datatable-cell adf-datatable-checkbox adf-datatable-checkbox-single" class="adf-datatable-cell adf-datatable-checkbox adf-datatable-checkbox-single"
tabindex="0"> tabindex="0">
<mat-checkbox <mat-checkbox
[id]="'select-file-' + idx" [id]="'select-file-' + idx"
[disabled]="!row?.isSelectable" [disabled]="!row?.isSelectable"
@ -273,7 +274,7 @@
</mat-icon> </mat-icon>
<ng-template #no_iconvalue> <ng-template #no_iconvalue>
<mat-icon class="adf-datatable-selected" <mat-icon class="adf-datatable-selected"
*ngIf="row.isSelected && !multiselect; else no_selected_row" svgIcon="selected" /> *ngIf="row.isSelected && !multiselect; else no_selected_row" svgIcon="selected" />
<ng-template #no_selected_row> <ng-template #no_selected_row>
<img class="adf-datatable-center-img-ie" <img class="adf-datatable-center-img-ie"
[attr.aria-label]="(data.getValue(row, col) | fileType) === 'disable' ? [attr.aria-label]="(data.getValue(row, col) | fileType) === 'disable' ?
@ -317,7 +318,7 @@
</div> </div>
<div *ngSwitchCase="'location'" [attr.tabindex]="data.getValue(row, col, resolverFn)? 0 : -1" class="adf-cell-value" <div *ngSwitchCase="'location'" [attr.tabindex]="data.getValue(row, col, resolverFn)? 0 : -1" class="adf-cell-value"
[attr.data-automation-id]="'location' + data.getValue(row, col, resolverFn)"> [attr.data-automation-id]="'location' + data.getValue(row, col, resolverFn)">
<adf-location-cell <adf-location-cell
[data]="data" [data]="data"
[column]="col" [column]="col"
@ -326,7 +327,7 @@
[tooltip]="getCellTooltip(row, col)" /> [tooltip]="getCellTooltip(row, col)" />
</div> </div>
<div *ngSwitchCase="'fileSize'" [attr.tabindex]="data.getValue(row, col, resolverFn)? 0 : -1" class="adf-cell-value" <div *ngSwitchCase="'fileSize'" [attr.tabindex]="data.getValue(row, col, resolverFn)? 0 : -1" class="adf-cell-value"
[attr.data-automation-id]="'fileSize_' + data.getValue(row, col, resolverFn)"> [attr.data-automation-id]="'fileSize_' + data.getValue(row, col, resolverFn)">
<adf-filesize-cell class="adf-datatable-center-size-column-ie" <adf-filesize-cell class="adf-datatable-center-size-column-ie"
[data]="data" [data]="data"
[column]="col" [column]="col"
@ -335,7 +336,7 @@
[tooltip]="getCellTooltip(row, col)" /> [tooltip]="getCellTooltip(row, col)" />
</div> </div>
<div *ngSwitchCase="'text'" [attr.tabindex]="data.getValue(row, col, resolverFn)? 0 : -1" class="adf-cell-value" <div *ngSwitchCase="'text'" [attr.tabindex]="data.getValue(row, col, resolverFn)? 0 : -1" class="adf-cell-value"
[attr.data-automation-id]="'text_' + data.getValue(row, col, resolverFn)"> [attr.data-automation-id]="'text_' + data.getValue(row, col, resolverFn)">
<adf-datatable-cell <adf-datatable-cell
[copyContent]="col.copyContent" [copyContent]="col.copyContent"
[data]="data" [data]="data"
@ -345,7 +346,7 @@
[tooltip]="getCellTooltip(row, col)" /> [tooltip]="getCellTooltip(row, col)" />
</div> </div>
<div *ngSwitchCase="'boolean'" [attr.tabindex]="data.getValue(row, col, resolverFn)? 0 : -1" class="adf-cell-value" <div *ngSwitchCase="'boolean'" [attr.tabindex]="data.getValue(row, col, resolverFn)? 0 : -1" class="adf-cell-value"
[attr.data-automation-id]="'boolean_' + data.getValue(row, col, resolverFn)"> [attr.data-automation-id]="'boolean_' + data.getValue(row, col, resolverFn)">
<adf-boolean-cell <adf-boolean-cell
[data]="data" [data]="data"
[column]="col" [column]="col"
@ -402,9 +403,9 @@
!showProvidedActions && !showProvidedActions &&
((actions && actionsPosition === 'right') || ((actions && actionsPosition === 'right') ||
(mainActionTemplate && showMainDatatableActions))" (mainActionTemplate && showMainDatatableActions))"
role="gridcell" role="gridcell"
tabindex="0" tabindex="0"
class="adf-datatable-cell adf-datatable__actions-cell adf-datatable-center-actions-column-ie adf-datatable-actions-menu"> class="adf-datatable-cell adf-datatable__actions-cell adf-datatable-center-actions-column-ie adf-datatable-actions-menu">
<ng-container *ngIf="(actions && actionsPosition === 'right')"> <ng-container *ngIf="(actions && actionsPosition === 'right')">
<button mat-icon-button [matMenuTriggerFor]="menu" #actionsMenuTrigger="matMenuTrigger" <button mat-icon-button [matMenuTriggerFor]="menu" #actionsMenuTrigger="matMenuTrigger"
@ -432,14 +433,15 @@
<div *ngIf="isEmpty()" role="row" class="adf-datatable-row"> <div *ngIf="isEmpty()" role="row" class="adf-datatable-row">
<div class="adf-no-content-container adf-datatable-cell" role="gridcell"> <div class="adf-no-content-container adf-datatable-cell" role="gridcell">
<ng-template *ngIf="noContentTemplate" <ng-template *ngIf="noContentTemplate"
ngFor [ngForOf]="[data]" ngFor [ngForOf]="[data]"
[ngForTemplate]="noContentTemplate"> [ngForTemplate]="noContentTemplate">
</ng-template> </ng-template>
<ng-content select="adf-empty-list"></ng-content> <ng-content select="adf-empty-list"></ng-content>
</div> </div>
</div> </div>
</ng-container> </ng-container>
<div *ngIf="!loading && noPermission"
<div *ngIf="noPermission"
role="row" role="row"
class="adf-datatable-row adf-no-permission__row"> class="adf-datatable-row adf-no-permission__row">
<div class="adf-no-permission__cell adf-no-content-container adf-datatable-cell"> <div class="adf-no-permission__cell adf-no-content-container adf-datatable-cell">
@ -449,13 +451,13 @@
</ng-template> </ng-template>
</div> </div>
</div> </div>
<div *ngIf="loading" class="adf-datatable-row"> </div>
<div class="adf-no-content-container adf-datatable-cell"> <div *ngIf="loading" class="adf-datatable-row">
<ng-template *ngIf="loadingTemplate" <div class="adf-no-content-container adf-datatable-cell">
ngFor [ngForOf]="[data]" <ng-template *ngIf="loadingTemplate"
[ngForTemplate]="loadingTemplate"> ngFor [ngForOf]="[data]"
</ng-template> [ngForTemplate]="loadingTemplate">
</div> </ng-template>
</div> </div>
</div> </div>
</div> </div>