Changeset - 698da65519a3
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 20 months ago 2023-05-29 20:23:16
drewp@bigasterisk.com
attempt to work around :host style not applying since this el got transplanted
1 file changed with 10 insertions and 1 deletions:
0 comments (0 inline, 0 general)
light9/web/floating_color_picker.ts
Show inline comments
 
@@ -227,16 +227,25 @@ class PickerFloat {
 
  private floatEl?: Light9ColorPickerFloat;
 

	
 
  pageInit() {
 
    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);
 
    }
 
    return this.floatEl;
 
  }
 

	
0 comments (0 inline, 0 general)