Et2Select: Fix all tags popup causes siblings to move / resize

This commit is contained in:
nathan 2023-11-24 08:33:54 -07:00
parent dff91f9a33
commit 41c6ec6100

View File

@ -730,7 +730,7 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
{ {
e.stopPropagation(); e.stopPropagation();
let distance = (-1 * parseInt(getComputedStyle(this).height)); let distance = (-1 * parseInt(getComputedStyle(this).height)) + 2;
// Bind to turn this all off // Bind to turn this all off
this.addEventListener("mouseleave", this._handleMouseLeave); this.addEventListener("mouseleave", this._handleMouseLeave);
@ -749,7 +749,7 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
popup.setAttribute("exportparts", "tags, popup"); popup.setAttribute("exportparts", "tags, popup");
popup.classList.add("hover__popup", "details", "hoist", "details__body"); popup.classList.add("hover__popup", "details", "hoist", "details__body");
this.shadowRoot.append(popup); this.shadowRoot.append(popup);
popup.appendChild(tags); popup.appendChild(tags.cloneNode(true));
tags.style.width = getComputedStyle(this).width; tags.style.width = getComputedStyle(this).width;
tags.style.margin = 0; tags.style.margin = 0;
}); });
@ -767,8 +767,6 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
if(popup) if(popup)
{ {
// Popup still here. Remove it // Popup still here. Remove it
let tags = popup.firstChild;
this.select.shadowRoot.querySelector(".select__combobox").append(tags);
popup.remove(); popup.remove();
} }
this.removeEventListener("mouseleave", this._handleMouseLeave); this.removeEventListener("mouseleave", this._handleMouseLeave);