@rogieking/figui3 1.0.13 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/fig.js +7 -7
  2. package/package.json +1 -1
package/fig.js CHANGED
@@ -678,18 +678,18 @@ class FigField extends HTMLElement {
678
678
  super()
679
679
  }
680
680
  connectedCallback() {
681
- this.label = this.querySelector('label')
682
- this.input = Array.from(this.childNodes).find(node => node.nodeName.toLowerCase().startsWith("fig-"))
683
- console.log('input:', this.input)
684
- if (this.input) {
685
- this.label.addEventListener('click', this.focus.bind(this))
686
- }
681
+ requestAnimationFrame(() => {
682
+ this.label = this.querySelector('label')
683
+ this.input = Array.from(this.childNodes).find(node => node.nodeName.toLowerCase().startsWith("fig-"))
684
+ if (this.input) {
685
+ this.label.addEventListener('click', this.focus.bind(this))
686
+ }
687
+ })
687
688
  }
688
689
  focus() {
689
690
  if (!this.input) {
690
691
  this.input = Array.from(this.childNodes).find(node => node.nodeName.toLowerCase().startsWith("fig-"))
691
692
  }
692
- console.log('input:', this.input)
693
693
  this.input.focus()
694
694
  }
695
695
  }
package/package.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@rogieking/figui3",
3
- "version": "1.0.13"
3
+ "version": "1.0.14"
4
4
  }