Mercurial > code > home > repos > light9
changeset 2271:698da65519a3
attempt to work around :host style not applying since this el got transplanted
author | drewp@bigasterisk.com |
---|---|
date | Mon, 29 May 2023 13:23:16 -0700 |
parents | b51c74da9d35 |
children | 9ca3d356b950 |
files | light9/web/floating_color_picker.ts |
diffstat | 1 files changed, 10 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/light9/web/floating_color_picker.ts Mon May 29 13:22:44 2023 -0700 +++ b/light9/web/floating_color_picker.ts Mon May 29 13:23:16 2023 -0700 @@ -230,10 +230,19 @@ this.getFloatEl(); this.getRainbow(); } - + private forceHostStyle(el: HTMLElement) { + el.style.zIndex = "10"; + el.style.position = "fixed"; + el.style.left = "0"; + el.style.top = "0"; + el.style.width = "100%"; + el.style.height = "100%"; + el.style.display = "none"; + } private getFloatEl(): Light9ColorPickerFloat { if (!this.floatEl) { this.floatEl = document.createElement("light9-color-picker-float") as Light9ColorPickerFloat; + this.forceHostStyle(this.floatEl); this.subscribeToFloatElement(this.floatEl); document.body.appendChild(this.floatEl); }