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 _let_ selectedElement = _this_.elementRef.nativeElement.querySelector('.wp-table--row.-checked'); _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_
_this_.elementRef.nativeElement.querySelector('.wp-card.-checked');
_if_ (selectedRow (selectedElement && selectedRow.previousSibling) selectedElement.previousSibling) {
selectedRow.previousSibling.scrollIntoView({block: "start"}); selectedElement = selectedElement.previousSibling;
}
_if_ (selectedCard)
_if_ (selectedElement) {
selectedCard.scrollIntoView({block: selectedElement.scrollIntoView({block: "start"});
}
}, 0);
});
WorkPackageListViewComponent
_this_.ngZone.runOutsideAngular(() => {
_setTimeout_(() => {
_const_ selectedRow
_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_
selectedRow.previousSibling.scrollIntoView({block: "start"});
}
_if_ (selectedCard)
_if_ (selectedElement)
selectedCard.scrollIntoView({block:
}
}, 0);
});