diff --git a/frontend/src/app/GN2CommonModule/form/datalist/datalist.component.ts b/frontend/src/app/GN2CommonModule/form/datalist/datalist.component.ts index e6df8bcdf8..54f283848d 100644 --- a/frontend/src/app/GN2CommonModule/form/datalist/datalist.component.ts +++ b/frontend/src/app/GN2CommonModule/form/datalist/datalist.component.ts @@ -79,11 +79,11 @@ export class DatalistComponent extends GenericFormComponent implements OnInit, O // if(this.nullDefault){ // values.push() // } - if(this.nullDefault && !this.required){ - let obj = {} - obj[this.keyValue] = null - obj[this.keyLabel] = "-- Aucun --" - values.unshift(obj) + if (this.nullDefault && !this.required) { + let obj = {}; + obj[this.keyValue] = null; + obj[this.keyLabel] = '-- Aucun --'; + values.unshift(obj); } values = values // filter search @@ -147,7 +147,7 @@ export class DatalistComponent extends GenericFormComponent implements OnInit, O this.filteredValues.length === 1 && !(this.parentFormControl.value && this.parentFormControl.value.length) ) { - const val = this.nullDefault ? null :this.values[0][this.keyValue]; + const val = this.nullDefault ? null : this.values[0][this.keyValue]; this.parentFormControl.patchValue(this.multiple && !this.nullDefault ? [val] : val); }