fix: Aggiunta opzione vuota se la select è facoltativa

This commit is contained in:
Maicol Battistini 2022-02-15 12:05:43 +01:00
parent 5c2dfff3cf
commit 6ab2925d5f
No known key found for this signature in database
GPG Key ID: 4FDB0F87CDB1D34A
1 changed files with 6 additions and 1 deletions

View File

@ -613,9 +613,14 @@ export class RecordsPage extends Page {
.first();
const select = section.fields[field.id] as SelectT;
let {options} = select;
// eslint-disable-next-line prefer-const
let {options, required} = select;
const {relationship} = select;
if (!required) {
list.push(<mwc-list-item key="null" value=""/>);
}
if (Array.isArray(relationship) && relationship.length === 2) {
options = this.getModelSelectOptions(relationship[0], relationship[1]);
}