mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-18 19:30:55 +01:00
Et2Select: Move option rendering into its own function, call it for Et2SelectAccount. This fixes missing option/label in some cases
eg: Kanban edit column Add/Remove assigned
This commit is contained in:
parent
5ff0cd7451
commit
ddee9a2b59
@ -47,6 +47,13 @@ export class Et2SelectAccount extends Et2Select
|
||||
this.__accountType = 'accounts';
|
||||
}
|
||||
|
||||
firstUpdated(changedProperties?)
|
||||
{
|
||||
super.firstUpdated(changedProperties);
|
||||
// Due to the different way Et2SelectAccount handles options, we call this explicitly
|
||||
this._renderOptions();
|
||||
}
|
||||
|
||||
set accountType(type : AccountType)
|
||||
{
|
||||
this.__accountType = type;
|
||||
|
@ -117,13 +117,7 @@ export const Et2widgetWithSelectMixin = <T extends Constructor<LitElement>>(supe
|
||||
if(changedProperties.has('select_options') || changedProperties.has("emptyLabel"))
|
||||
{
|
||||
// Add in options as children to the target node
|
||||
if(this._optionTargetNode)
|
||||
{
|
||||
render(html`${this._emptyLabelTemplate()}
|
||||
${repeat(<SelectOption[]>this.select_options, (option : SelectOption) => option.value, this._optionTemplate.bind(this))}`,
|
||||
this._optionTargetNode
|
||||
);
|
||||
}
|
||||
this._renderOptions();
|
||||
if(this.handleMenuSlotChange)
|
||||
{
|
||||
this.handleMenuSlotChange();
|
||||
@ -131,6 +125,22 @@ export const Et2widgetWithSelectMixin = <T extends Constructor<LitElement>>(supe
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Render select_options as child DOM Nodes
|
||||
* @protected
|
||||
*/
|
||||
protected _renderOptions()
|
||||
{
|
||||
// Add in options as children to the target node
|
||||
if(this._optionTargetNode)
|
||||
{
|
||||
render(html`${this._emptyLabelTemplate()}
|
||||
${repeat(<SelectOption[]>this.select_options, (option : SelectOption) => option.value, this._optionTemplate.bind(this))}`,
|
||||
this._optionTargetNode
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Overwritten as sometimes called before this._inputNode is available
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user