bind overall tooltip only on the combobox and not on the whole popup.

The tree can now show its own tooltips without interference
This commit is contained in:
milan 2024-08-28 18:23:20 +02:00
parent 55c6b122d2
commit 986e83750c
3 changed files with 21 additions and 5 deletions

View File

@ -85,6 +85,17 @@ export class Et2SelectCategory extends Et2StaticSelectMixin(Et2TreeDropdown)
}); });
} }
bindTooltip()
{
//overide so tooltip wont be bound
this.updateComplete.then(() => {
const box = this.shadowRoot?.querySelector('.tree-dropdown__combobox');
if(box){
this.egw().tooltipBind(box, this.egw().lang(this.statustext))
}
})
}
willUpdate(changedProperties : PropertyValues) willUpdate(changedProperties : PropertyValues)
{ {
super.willUpdate(changedProperties); super.willUpdate(changedProperties);

View File

@ -891,7 +891,7 @@ export class Et2Tree extends Et2WidgetWithSelectMixin(LitElement) implements Fin
part="item" part="item"
exportparts="checkbox, label, item:item-item" exportparts="checkbox, label, item:item-item"
id=${value} id=${value}
title=${selectOption.tooltip || nothing} title=${selectOption.tooltip ||selectOption.title || nothing}
class=${selectOption.class || nothing} class=${selectOption.class || nothing}
?selected=${typeof this.value == "string" && this.value == value || Array.isArray(this.value) && this.value.includes(value)} ?selected=${typeof this.value == "string" && this.value == value || Array.isArray(this.value) && this.value.includes(value)}
?expanded=${expandState} ?expanded=${expandState}

View File

@ -313,13 +313,17 @@ const Et2WidgetMixin = <T extends Constructor>(superClass : T) =>
super.connectedCallback(); super.connectedCallback();
this.addEventListener("click", this._handleClick); this.addEventListener("click", this._handleClick);
if (this.statustext && !egwIsMobile()) if (this.statustext && !egwIsMobile())
{ {
this.egw().tooltipBind(this, this.egw().lang(this.statustext)); this.bindTooltip();
} }
} }
bindTooltip()
{
this.egw().tooltipBind(this, this.egw().lang(this.statustext));
}
disconnectedCallback() disconnectedCallback()
{ {
this.egw()?.tooltipUnbind(this); this.egw()?.tooltipUnbind(this);
@ -327,6 +331,7 @@ const Et2WidgetMixin = <T extends Constructor>(superClass : T) =>
this.removeEventListener("click", this._handleClick); this.removeEventListener("click", this._handleClick);
} }
/** /**
* NOT the setter, since we cannot add to the DOM before connectedCallback() * NOT the setter, since we cannot add to the DOM before connectedCallback()
* *
@ -513,7 +518,7 @@ const Et2WidgetMixin = <T extends Constructor>(superClass : T) =>
this.egw().tooltipUnbind(this); this.egw().tooltipUnbind(this);
if(this.statustext) if(this.statustext)
{ {
this.egw().tooltipBind(this, this.statustext); this.bindTooltip()
} }
} }
if(changedProperties.has("onclick")) if(changedProperties.has("onclick"))