web/elements: correctly display selected empty option when blankable is enabled
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
5cab280759
commit
9ea0441559
|
@ -65,6 +65,9 @@ export class SearchSelect<T> extends AKElement {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@property()
|
||||||
|
emptyOption = "---------";
|
||||||
|
|
||||||
@property({ attribute: false })
|
@property({ attribute: false })
|
||||||
groupBy: (items: T[]) => [string, T[]][] = (items: T[]): [string, T[]][] => {
|
groupBy: (items: T[]) => [string, T[]][] = (items: T[]): [string, T[]][] => {
|
||||||
return groupBy(items, () => {
|
return groupBy(items, () => {
|
||||||
|
@ -165,7 +168,7 @@ export class SearchSelect<T> extends AKElement {
|
||||||
this.open = false;
|
this.open = false;
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
---------
|
${this.emptyOption}
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
`
|
`
|
||||||
|
@ -212,7 +215,11 @@ export class SearchSelect<T> extends AKElement {
|
||||||
this.renderMenu();
|
this.renderMenu();
|
||||||
}, 200);
|
}, 200);
|
||||||
}}
|
}}
|
||||||
.value=${this.selectedObject ? this.renderElement(this.selectedObject) : ""}
|
.value=${this.selectedObject
|
||||||
|
? this.renderElement(this.selectedObject)
|
||||||
|
: this.blankable
|
||||||
|
? this.emptyOption
|
||||||
|
: ""}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Reference in New Issue