mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-08-17 20:11:23 +02:00
Et2Select: All selectboxes now stop scroll event from bubbling to prevent parent (sidemenu) from scrolling too
This commit is contained in:
@@ -163,12 +163,15 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
|
||||
|
||||
this._triggerChange = this._triggerChange.bind(this);
|
||||
this._doResize = this._doResize.bind(this);
|
||||
this._handleMouseWheel = this._handleMouseWheel.bind(this);
|
||||
}
|
||||
|
||||
connectedCallback()
|
||||
{
|
||||
super.connectedCallback();
|
||||
|
||||
this.addEventListener("mousewheel", this._handleMouseWheel);
|
||||
|
||||
this.updateComplete.then(() =>
|
||||
{
|
||||
this.addEventListener("sl-change", this._triggerChange);
|
||||
@@ -180,6 +183,7 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
|
||||
{
|
||||
super.disconnectedCallback();
|
||||
|
||||
this.removeEventListener("mousewheel", this._handleMouseWheel);
|
||||
this.removeEventListener("sl-clear", this._triggerChange)
|
||||
this.removeEventListener("sl-change", this._triggerChange);
|
||||
this.removeEventListener("sl-after-show", this._doResize);
|
||||
@@ -210,6 +214,16 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
|
||||
this.menu.style.width = "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop scroll from bubbling so the sidemenu doesn't scroll too
|
||||
*
|
||||
* @param {MouseEvent} e
|
||||
*/
|
||||
private _handleMouseWheel(e : MouseEvent)
|
||||
{
|
||||
e.stopPropagation();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the node where we're putting the selection options
|
||||
*
|
||||
|
Reference in New Issue
Block a user