Skip to content

Commit

Permalink
111768: add back necessary setCurrentValue calls that were removed ea…
Browse files Browse the repository at this point in the history
…rlier
  • Loading branch information
Jens Vannerum committed Feb 14, 2024
1 parent 5c84ede commit 9767260
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
import { UntypedFormGroup } from '@angular/forms';

import { Observable, of as observableOf } from 'rxjs';
import { catchError, map, tap } from 'rxjs/operators';
import { catchError, distinctUntilChanged, map, tap } from 'rxjs/operators';
import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap';
import { DynamicFormLayoutService, DynamicFormValidationService } from '@ng-dynamic-forms/core';

Expand Down Expand Up @@ -79,6 +79,10 @@ export class DsDynamicScrollableDropdownComponent extends DsDynamicVocabularyCom
tap(() => this.loading = false)
).subscribe((list: PaginatedList<VocabularyEntry>) => {
this.optionsList = list.page;
if (this.model.value) {
this.setCurrentValue(this.model.value, true);
}

this.updatePageInfo(
list.pageInfo.elementsPerPage,
list.pageInfo.currentPage,
Expand All @@ -88,6 +92,11 @@ export class DsDynamicScrollableDropdownComponent extends DsDynamicVocabularyCom
this.selectedIndex = 0;
this.cdr.detectChanges();
});

this.group.get(this.model.id).valueChanges.pipe(distinctUntilChanged())
.subscribe((value) => {
this.setCurrentValue(value);

Check warning on line 98 in src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.ts

View check run for this annotation

Codecov / codecov/patch

src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.ts#L98

Added line #L98 was not covered by tests
});
}

/**
Expand Down

0 comments on commit 9767260

Please sign in to comment.