Skip to content

Commit

Permalink
Fix salesagility#323 - Dynamic dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexMyddleware committed Feb 28, 2024
1 parent 41dd042 commit 44d0158
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions core/app/core/src/lib/fields/base/base-enum.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,15 @@ export class BaseEnumComponent extends BaseFieldComponent implements OnInit, OnD
values = [values];
}

// Reset selected values on Form Control
this.field.value = '';
this.field.formControl.setValue('');

// Rebuild available enum options
this.options = this.filterMatchingOptions(values);

// reset value on dynamic enum value if parent enum is empty or does not allow the selected value
if (!(this.options.some(option => option.value === this.field.value)) || values == ''){
this.field.value = '';
this.field.formControl.setValue('');
}

this.initValue();
}));
}
Expand Down

0 comments on commit 44d0158

Please sign in to comment.