fixes error shows on development mode "value changed after it was checked... " on listings

This commit is contained in:
apapachristou 2020-07-09 10:53:17 +03:00
parent f451314473
commit 397e23e4d1
4 changed files with 14 additions and 2 deletions

View File

@ -13,7 +13,7 @@
</div>
</div>
</div>
<div class="filter-btn" [style.right]="dialog.openDialogs.length > 0 ? '446px' : '0px'" [style.width]="hasScrollbar() ? '52px' : '37px'" (click)="openFiltersDialog()">
<div class="filter-btn" [style.right]="dialog.openDialogs.length > 0 ? '446px' : '0px'" [style.width]="scrollbar ? '57px' : '37px'" (click)="openFiltersDialog()">
<button mat-raised-button class="p-0">
<mat-icon class="mr-4">filter_alt</mat-icon>
</button>

View File

@ -54,6 +54,8 @@ export class DatasetListingComponent extends BaseComponent implements OnInit, IB
like: new FormControl()
});
scrollbar: boolean;
constructor(
private datasetService: DatasetService,
private router: Router,
@ -118,6 +120,10 @@ export class DatasetListingComponent extends BaseComponent implements OnInit, IB
.subscribe(x => this.controlModified());
}
ngAfterContentChecked(): void {
this.scrollbar = this.hasScrollbar();
}
controlModified(): void {
// this.clearErrorModel();
// if (this.refreshCallback != null &&

View File

@ -8,7 +8,7 @@
<p class="mt-4 pt-2">{{'DMP-LISTING.TEXT-INFO-QUESTION' | translate}} <u>{{'DMP-LISTING.LINK-ZENODO' | translate}}</u> {{'DMP-LISTING.GET-IDEA' | translate}}</p>
</div>
</div>
<div class="filter-btn" [style.right]="dialog.openDialogs.length > 0 ? '446px' : '0px'" [style.width]="hasScrollbar() ? '52px' : '37px'" (click)="openFiltersDialog()">
<div class="filter-btn" [style.right]="dialog.openDialogs.length > 0 ? '446px' : '0px'" [style.width]="scrollbar ? '57px' : '37px'" (click)="openFiltersDialog()">
<button mat-raised-button class="p-0">
<mat-icon class="mr-4">filter_alt</mat-icon>
</button>

View File

@ -59,6 +59,8 @@ export class DmpListingComponent extends BaseComponent implements OnInit, IBread
like: new FormControl()
});
scrollbar: boolean;
constructor(
private dmpService: DmpService,
private router: Router,
@ -164,6 +166,10 @@ export class DmpListingComponent extends BaseComponent implements OnInit, IBread
.subscribe(x => this.controlModified());
}
ngAfterContentChecked(): void {
this.scrollbar = this.hasScrollbar();
}
public refresh(resetPages = false) {
// if (this._paginator.pageSize === undefined) this._paginator.pageSize = 10;
// if (resetPages) this._paginator.pageIndex = 0;