mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-19 08:26:52 +02:00
Fix tree showed leaf as selected on partial ID matches
eg: 6, 60 & 600 would all be selected if value is "6"
This commit is contained in:
parent
824f6416ca
commit
abc25683af
@ -670,6 +670,7 @@ export class Et2Tree extends Et2WidgetWithSelectMixin(LitElement)
|
|||||||
this.getDomNode(selectOption.id)?.dispatchEvent(new CustomEvent("sl-lazy-load"));
|
this.getDomNode(selectOption.id)?.dispatchEvent(new CustomEvent("sl-lazy-load"));
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
const value = selectOption.value ?? selectOption.id;
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<sl-tree-item
|
<sl-tree-item
|
||||||
@ -677,7 +678,7 @@ export class Et2Tree extends Et2WidgetWithSelectMixin(LitElement)
|
|||||||
exportparts="checkbox, label"
|
exportparts="checkbox, label"
|
||||||
id=${selectOption.id}
|
id=${selectOption.id}
|
||||||
title=${selectOption.tooltip || nothing}
|
title=${selectOption.tooltip || nothing}
|
||||||
?selected=${typeof this.value == "string" && this.value == selectOption.id || typeof this.value?.includes == "function" && this.value.includes(selectOption.id)}
|
?selected=${typeof this.value == "string" && this.value == value || Array.isArray(this.value) && this.value.includes(value)}
|
||||||
?expanded=${expandState}
|
?expanded=${expandState}
|
||||||
?lazy=${lazy}
|
?lazy=${lazy}
|
||||||
?focused=${selectOption.focused || nothing}
|
?focused=${selectOption.focused || nothing}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user