Fix dropdown took over nextmatch header

This commit is contained in:
nathan 2022-05-17 09:40:34 -06:00
parent 3658d4e7f2
commit 5528261050

View File

@ -41,7 +41,10 @@ export class Et2DropdownButton extends Et2widgetWithSelectMixin(Et2Button)
buttonStyles, buttonStyles,
css` css`
:host { :host {
display: contents; /* Avoid unwanted style overlap from button */
border: none;
background-color: none;
/** /**
Adapt shoelace color variables to what we want Adapt shoelace color variables to what we want
Maybe some logical variables from etemplate2.css here? Maybe some logical variables from etemplate2.css here?
@ -52,6 +55,9 @@ export class Et2DropdownButton extends Et2widgetWithSelectMixin(Et2Button)
--sl-color-primary-400: var(--input-border-color); --sl-color-primary-400: var(--input-border-color);
--sl-color-primary-700: #505050; --sl-color-primary-700: #505050;
} }
:host(:active), :host([active]) {
background-color: initial;
}
`, `,
]; ];
} }
@ -85,8 +91,14 @@ export class Et2DropdownButton extends Et2widgetWithSelectMixin(Et2Button)
// Need to wait until update is done and these exist // Need to wait until update is done and these exist
this.updateComplete.then(() => this.updateComplete.then(() =>
{ {
this.buttonNode.addEventListener("click", this._handleClick); if(this.buttonNode)
this.dropdownNode.addEventListener('sl-select', this._handleSelect); {
this.buttonNode.addEventListener("click", this._handleClick);
}
if(this.dropdownNode)
{
this.dropdownNode.addEventListener('sl-select', this._handleSelect);
}
}); });
} }