@rogieking/figui3 2.0.0 → 2.0.1

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 +8 -1
  2. package/package.json +1 -1
package/fig.js CHANGED
@@ -2338,7 +2338,14 @@ class FigCheckbox extends HTMLElement {
2338
2338
  if (!this.labelElement) {
2339
2339
  this.labelElement = document.createElement("label");
2340
2340
  this.labelElement.setAttribute("for", this.input.id);
2341
- this.append(this.labelElement);
2341
+ }
2342
+ // Add to DOM if not already there and input is in the DOM
2343
+ if (
2344
+ this.labelElement &&
2345
+ !this.labelElement.parentNode &&
2346
+ this.input.parentNode
2347
+ ) {
2348
+ this.input.after(this.labelElement);
2342
2349
  }
2343
2350
  }
2344
2351
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rogieking/figui3",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "devDependencies": {