mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
fix not working onchange with Shoelace components: need to bind sl-change instead of change
adding change handler to invoker mixing to enable/disable invoker when value changes
This commit is contained in:
parent
1b9e2367e1
commit
0ad3cf9832
@ -148,14 +148,14 @@ const Et2InputWidgetMixin = <T extends Constructor<LitElement>>(superclass : T)
|
|||||||
this.node = this.getInputNode();
|
this.node = this.getInputNode();
|
||||||
this.updateComplete.then(() =>
|
this.updateComplete.then(() =>
|
||||||
{
|
{
|
||||||
this.addEventListener("change", this._oldChange);
|
this.addEventListener(typeof (<any>this).handleChange === 'function' ? 'sl-change' : 'change', this._oldChange);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
disconnectedCallback()
|
disconnectedCallback()
|
||||||
{
|
{
|
||||||
super.disconnectedCallback();
|
super.disconnectedCallback();
|
||||||
this.removeEventListener("change", this._oldChange);
|
this.removeEventListener(typeof (<any>this).handleChange === 'function' ? 'sl-change' : 'change', this._oldChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -179,6 +179,19 @@ export const Et2InvokerMixin = dedupeMixin(<T extends Constructor<LitElement>>(s
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reimplemented to enable/disable invoker on content change
|
||||||
|
*
|
||||||
|
* @param _ev
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
_oldChange(_ev: Event): boolean
|
||||||
|
{
|
||||||
|
this._toggleInvokerDisabled();
|
||||||
|
|
||||||
|
return super._oldChange(_ev);
|
||||||
|
}
|
||||||
|
|
||||||
/** @param {import('@lion/core').PropertyValues } changedProperties */
|
/** @param {import('@lion/core').PropertyValues } changedProperties */
|
||||||
firstUpdated(changedProperties)
|
firstUpdated(changedProperties)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user