Skip to content

Commit

Permalink
Fix selection bugs with cert template picker
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-bstein committed Jan 3, 2025
1 parent c83c3bc commit dbed4ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
</label>

<div class="input-group">
<select id="feedbackTemplate" class="form-control" [(ngModel)]="selectedTemplate"
(change)="handleTemplateSelect()">
<select id="feedbackTemplate" class="form-control" [ngModel]="selectedTemplate"
(ngModelChange)="handleTemplateSelect()">
<option [ngValue]="undefined">{{ defaultOptionText }}</option>
<option *ngFor="let template of templates" [ngValue]="template">
{{ template.name }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ export class CertificateTemplatePickerComponent implements OnInit, OnChanges {
}

async ngOnChanges(changes: SimpleChanges): Promise<void> {
if (changes.selectedTemplateId?.currentValue && changes.selectedTemplateId.currentValue !== this.selectedTemplate?.id) {
if (changes.selectedTemplateId.isFirstChange()) {
await this.load();
}

if (changes.selectedTemplateId?.currentValue && changes.selectedTemplateId.currentValue !== this.selectedTemplate?.id) {
this.selectedTemplate = this.templates.find(t => t.id === changes.selectedTemplateId.currentValue);
}
}
Expand Down

0 comments on commit dbed4ba

Please sign in to comment.