mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
[HIMA-911] Article detail page: auto-scroll to top on product selection change implementation
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<div
|
||||
id="product-detail-container"
|
||||
class="product-detail-container"
|
||||
#productDetailContainer
|
||||
*ngIf="product"
|
||||
[@shrinkMainCard]="expanded"
|
||||
(scroll)="scrollHandler($event)"
|
||||
|
||||
@@ -43,6 +43,7 @@ import { allowedAvailabilityStatusCodes } from 'apps/sales/src/app/core/utils/pr
|
||||
animations: [shrinkTitleAnimation, shrinkSecondaryAnimation, shrinkMainCard]
|
||||
})
|
||||
export class ProductDetailsComponent implements OnInit, OnDestroy {
|
||||
@ViewChild('productDetailContainer', { read: ElementRef }) private productDetailContainer: ElementRef<any>;
|
||||
@ViewChild('checkout') checkoutDialog: ProductCheckoutComponent;
|
||||
@ViewChild('photoGallery') photoGallery: PhotoGalleryComponent;
|
||||
@ViewChild('productReview') productReview: ProductReviewComponent;
|
||||
@@ -306,6 +307,9 @@ export class ProductDetailsComponent implements OnInit, OnDestroy {
|
||||
takeUntil(this.destroy$)
|
||||
)
|
||||
.subscribe((item: ItemDTO) => {
|
||||
if (this.productDetailContainer) {
|
||||
this.productDetailContainer.nativeElement.scrollTop = 0;
|
||||
}
|
||||
if (item) {
|
||||
this.availability = [];
|
||||
this.addSelectedItemToProcessIfMissingOrChanged(item);
|
||||
@@ -351,6 +355,9 @@ export class ProductDetailsComponent implements OnInit, OnDestroy {
|
||||
filter(item => !isNullOrUndefined(item))
|
||||
)
|
||||
.subscribe((item: ItemDTO) => {
|
||||
if (this.productDetailContainer) {
|
||||
this.productDetailContainer.nativeElement.scrollTop = 0;
|
||||
}
|
||||
this.item = item;
|
||||
this.product = this.productDetailMapper(item);
|
||||
this.product.fullDescription =
|
||||
|
||||
Reference in New Issue
Block a user