mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 07:53:39 +01: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"));
|
||||
})
|
||||
}
|
||||
const value = selectOption.value ?? selectOption.id;
|
||||
|
||||
return html`
|
||||
<sl-tree-item
|
||||
@ -677,7 +678,7 @@ export class Et2Tree extends Et2WidgetWithSelectMixin(LitElement)
|
||||
exportparts="checkbox, label"
|
||||
id=${selectOption.id}
|
||||
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}
|
||||
?lazy=${lazy}
|
||||
?focused=${selectOption.focused || nothing}
|
||||
|
Loading…
Reference in New Issue
Block a user