Skip to content

Commit

Permalink
Fix focus after profile delete - track by name (#640)
Browse files Browse the repository at this point in the history
Fix focus after profile delete - track by name
  • Loading branch information
sofyakurilova committed Aug 2, 2024
1 parent c74ec77 commit 4c25a91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,7 @@ <h2 class="profiles-drawer-header-title">Saved profiles</h2>
</div>
<div class="profiles-drawer-content">
<app-profile-item
*ngFor="
let profile of vm.profiles;
let i = index;
trackBy: trackByIndex
"
*ngFor="let profile of vm.profiles; let i = index; trackBy: trackByName"
[profile]="profile"
class="profile-item-{{ i }}"
[ngClass]="{ selected: profile.name === vm.selectedProfile?.name }"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ export class RiskAssessmentComponent implements OnInit, OnDestroy {
}
}

trackByIndex = (index: number): number => {
return index;
trackByName = (index: number, item: Profile): string => {
return item.name;
};

private closeFormAfterDelete(name: string, selectedProfile: Profile | null) {
Expand Down

0 comments on commit 4c25a91

Please sign in to comment.