Content
View differences
Updated by Aleix Suau almost 6 years ago
Sometimes, when scrolling back from a wp detail page, the header of the workpackages table hides the rolled into view element (the last opened wp (-checked)). Scrolling the previous element instead (if any) avoids this possibility.
WorkPackageListViewComponent
_this_.ngZone.runOutsideAngular(() => {
_setTimeout_(() => {
_const_ selectedRow = _this_.elementRef.nativeElement.querySelector('.wp-table--row.-checked');
_const_ selectedCard = _this_.elementRef.nativeElement.querySelector('.wp-card.-checked');
_// The header of the table hides the scrolledIntoView element_
_// so we scrollIntoView the previous element, if any_
_if_ (selectedRow && selectedRow.previousSibling) {
selectedRow.previousSibling.scrollIntoView({block: "start"});
}
_if_
_if_ (selectedCard) {
selectedCard.scrollIntoView({block: "start"});
}
}, 0);
});
WorkPackageListViewComponent
_this_.ngZone.runOutsideAngular(() => {
_setTimeout_(() => {
_const_ selectedRow = _this_.elementRef.nativeElement.querySelector('.wp-table--row.-checked');
_const_ selectedCard = _this_.elementRef.nativeElement.querySelector('.wp-card.-checked');
_// The header of the table hides the scrolledIntoView element_
selectedRow.previousSibling.scrollIntoView({block: "start"});
}
_if_
_if_
selectedCard.scrollIntoView({block: "start"});
}
}, 0);
});