mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 04:29:28 +01:00
fix getValue()
This commit is contained in:
parent
317f2fdbb9
commit
0287ce0e0d
@ -347,7 +347,7 @@ export class Et2Tree extends Et2WidgetWithSelectMixin(LitElement)
|
||||
*/
|
||||
public getSelectedItem(): TreeItemData
|
||||
{
|
||||
return this._currentOption || this._selectOptions[0]
|
||||
return this._currentOption || (this._selectOptions ? this._selectOptions[0] : null);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -356,17 +356,19 @@ export class Et2Tree extends Et2WidgetWithSelectMixin(LitElement)
|
||||
*/
|
||||
getValue()
|
||||
{
|
||||
if(this.multiple){
|
||||
let res:string[] = []
|
||||
if(this.multiple)
|
||||
{
|
||||
let res:string[] = [];
|
||||
if(this.selectedNodes?.length)
|
||||
{
|
||||
for (const selectedNode of this.selectedNodes)
|
||||
{
|
||||
res.push(selectedNode.id)
|
||||
res.push(selectedNode.id);
|
||||
}
|
||||
return res}
|
||||
else {
|
||||
this.getSelectedItem().id
|
||||
}
|
||||
return res;
|
||||
}
|
||||
return this.getSelectedItem()?.id;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user