Parcourir la source

fix(admin-ui): Allow removing last item from ProductSelectorFromInput

Michael Bromley il y a 5 ans
Parent
commit
21db8cf322

+ 1 - 1
packages/admin-ui/src/lib/core/src/shared/dynamic-form-inputs/product-selector-form-input/product-selector-form-input.component.ts

@@ -40,7 +40,7 @@ export class ProductSelectorFormInputComponent implements FormInputComponent, On
         this.selection$ = this.formControl.valueChanges.pipe(
             startWith(this.formControl.value),
             switchMap(value => {
-                if (Array.isArray(value)) {
+                if (Array.isArray(value) && 0 < value.length) {
                     return forkJoin(
                         value.map(id =>
                             this.dataService.product