mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 00:54:15 +01:00
Et2Select: Allow dropdown option list to be wider than the field
This commit is contained in:
parent
3f3e7559f1
commit
67b9102a69
@ -96,6 +96,7 @@ export class Et2Select extends Et2WithSearchMixin(Et2InvokerMixin(Et2WidgetWithS
|
||||
{
|
||||
super();
|
||||
this._triggerChange = this._triggerChange.bind(this);
|
||||
this._doResize = this._doResize.bind(this);
|
||||
}
|
||||
|
||||
connectedCallback()
|
||||
@ -106,6 +107,7 @@ export class Et2Select extends Et2WithSearchMixin(Et2InvokerMixin(Et2WidgetWithS
|
||||
{
|
||||
this.addEventListener("sl-clear", this._triggerChange)
|
||||
this.addEventListener("sl-change", this._triggerChange);
|
||||
this.addEventListener("sl-after-show", this._doResize)
|
||||
});
|
||||
}
|
||||
|
||||
@ -115,6 +117,7 @@ export class Et2Select extends Et2WithSearchMixin(Et2InvokerMixin(Et2WidgetWithS
|
||||
|
||||
this.removeEventListener("sl-clear", this._triggerChange)
|
||||
this.removeEventListener("sl-change", this._triggerChange);
|
||||
this.removeEventListener("sl-after-show", this._doResize);
|
||||
}
|
||||
|
||||
firstUpdated(changedProperties?)
|
||||
@ -136,6 +139,18 @@ export class Et2Select extends Et2WithSearchMixin(Et2InvokerMixin(Et2WidgetWithS
|
||||
this.dispatchEvent(new Event("change"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the menu sizing to allow the menu to be wider than the field width, but no smaller
|
||||
*
|
||||
* @param e
|
||||
* @private
|
||||
*/
|
||||
private _doResize(e)
|
||||
{
|
||||
this.menu.style.minWidth = this.menu.style.width;
|
||||
this.menu.style.width = "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the node where we're putting the selection options
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user