mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-5013] Dropdown does not display the default value
This commit is contained in:
@@ -6,7 +6,6 @@
|
|||||||
[id]="field.id"
|
[id]="field.id"
|
||||||
[(ngModel)]="field.value"
|
[(ngModel)]="field.value"
|
||||||
[disabled]="field.readOnly"
|
[disabled]="field.readOnly"
|
||||||
[compareWith]="compareDropdownValues"
|
|
||||||
(ngModelChange)="onFieldChanged(field)">
|
(ngModelChange)="onFieldChanged(field)">
|
||||||
<mat-option *ngFor="let opt of field.options"
|
<mat-option *ngFor="let opt of field.options"
|
||||||
[value]="getOptionValue(opt, field.value)"
|
[value]="getOptionValue(opt, field.value)"
|
||||||
|
@@ -82,10 +82,6 @@ export class DropdownCloudWidgetComponent extends WidgetComponent implements OnI
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
compareDropdownValues(opt1: string, opt2: FormFieldOption): boolean {
|
|
||||||
return opt1 && opt2 && ( opt1 === opt2.id || opt1 === opt2.name);
|
|
||||||
}
|
|
||||||
|
|
||||||
getOptionValue(option: FormFieldOption, fieldValue: string): string {
|
getOptionValue(option: FormFieldOption, fieldValue: string): string {
|
||||||
let optionValue: string = '';
|
let optionValue: string = '';
|
||||||
if (option.id === 'empty' || option.name !== fieldValue) {
|
if (option.id === 'empty' || option.name !== fieldValue) {
|
||||||
|
Reference in New Issue
Block a user