Skip to content

Commit 7acab3b

Browse files
authored
fix: scroll to top when new step loads (#401)
1 parent 817c110 commit 7acab3b

File tree

7 files changed

+14
-12
lines changed

7 files changed

+14
-12
lines changed

packages/angular-sdk-components/src/lib/_components/designSystemExtension/banner/banner.component.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
column-gap: calc(2 * 0.5rem);
2121
row-gap: calc(2 * 0.5rem);
2222
align-items: start;
23+
24+
& > *:nth-child(1) {
25+
min-width: 0;
26+
}
2327
}
2428

2529
.psdk-grid-filter-narrow-wide {

packages/angular-sdk-components/src/lib/_components/field/date-time/date-time.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms';
44
import { MatDatepickerModule } from '@angular/material/datepicker';
55
import { MatInputModule } from '@angular/material/input';
66
import { MatFormFieldModule } from '@angular/material/form-field';
7-
87
import { ScrollStrategyOptions } from '@angular/cdk/overlay';
9-
108
import { OwlDateTimeModule, OwlNativeDateTimeModule } from '@danielmoncada/angular-datetime-picker';
119
import dayjs from 'dayjs';
1210

packages/angular-sdk-components/src/lib/_components/infra/assignment/assignment.component.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ function getRefreshProps(refreshConditions) {
1818
return refreshConditions.filter(item => item.event && item.event === 'Changes').map(item => [item.field, item.field?.substring(1)]) || [];
1919
}
2020

21+
function scrollToTop() {
22+
const scrollElement = document.querySelector('.psdk-view-container-top');
23+
scrollElement?.scrollIntoView();
24+
}
25+
2126
interface AssignmentProps {
2227
// If any, enter additional props that only exist on this component
2328
template: string;
@@ -140,6 +145,8 @@ export class AssignmentComponent implements OnInit, OnDestroy, OnChanges {
140145
}
141146

142147
updateChanges() {
148+
scrollToTop();
149+
143150
this.registerForRefresh();
144151

145152
// pConn$ may be a 'reference' component, so normalize it

packages/angular-sdk-components/src/lib/_components/template/confirmation/confirmation.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div>
22
<div *ngIf="showConfirmView">
33
<h2 id="confirm-label" class="confirm-label">{{ label }}</h2>
4-
<div *ngIf="showDetails">
4+
<div *ngIf="showDetails" class="confirmation-details">
55
<component-mapper name="Details" [props]="{ pConn$ }"></component-mapper>
66
</div>
77
<div *ngIf="showTasks && toDoList?.length > 0">

packages/angular-sdk-components/src/lib/_components/template/wss-nav-bar/wss-nav-bar.component.scss

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
padding-top: 0.625rem;
1616
cursor: pointer;
1717
padding-right: 1rem;
18-
&:hover {
19-
}
2018
align-items: center;
2119
}
2220

@@ -106,9 +104,6 @@
106104

107105
.psdk-nav-button-span {
108106
padding: 0 1rem;
109-
110-
&:hover {
111-
}
112107
}
113108

114109
.psdk-nav-oper-avatar {
@@ -148,9 +143,6 @@ mat-list-item {
148143
cursor: pointer !important;
149144
height: auto !important;
150145

151-
&:hover {
152-
}
153-
154146
.flex-box {
155147
display: flex;
156148
align-items: center;

projects/angular-test-app/src/app/_samples/full-portal/full-portal.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</div>
1818
</div>
1919
<div *ngIf="bPCoreReady$">
20-
<div *ngIf="sComponentName$ == 'RootContainer'">
20+
<div *ngIf="sComponentName$ == 'RootContainer'" id="pega-portal-container">
2121
<component-mapper name="RootContainer" [props]="{ pConn$ }"></component-mapper>
2222
</div>
2323
</div>

projects/angular-test-app/src/containerStyles.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,6 @@ app-view-container {
7171

7272
.psdk-view-container-top {
7373
padding: 0;
74+
scroll-margin-top: 64px;
7475
}
7576
}

0 commit comments

Comments
 (0)