@vollowx/seele 0.10.0 → 0.10.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vollowx/seele",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "Standard Extensible Elements. A web components library that can be styled and extended freely, pre-providing components in Material Design 3.",
5
5
  "author": "vollowx",
6
6
  "license": "MIT",
@@ -45,14 +45,14 @@ export const Attachable = (superClass) => {
45
45
  this.setCurrentControl(this.$control);
46
46
  }
47
47
  }
48
- setCurrentControl(control) {
49
- if (control === this.currentControl)
48
+ setCurrentControl(control, force = false) {
49
+ if (control === this.currentControl && !force)
50
50
  return;
51
51
  this.handleControlChange(this.currentControl, control);
52
52
  this.currentControl = control;
53
53
  }
54
- attach(control) {
55
- this.setCurrentControl(control);
54
+ attach(control, force = false) {
55
+ this.setCurrentControl(control, force);
56
56
  this.removeAttribute('for');
57
57
  }
58
58
  detach() {
@@ -38,8 +38,8 @@ let M3Checkbox = class M3Checkbox extends Checkbox {
38
38
  connectedCallback() {
39
39
  super.connectedCallback();
40
40
  // SSR'd <md-checkbox> components don't have their labels set up on time
41
- setTimeout(() => {
42
- this.$ripple.attach(this);
41
+ this.updateComplete.then(() => {
42
+ this.$ripple.attach(this, true);
43
43
  });
44
44
  }
45
45
  };
package/src/m3/switch.js CHANGED
@@ -87,7 +87,7 @@ let M3Switch = class M3Switch extends Switch {
87
87
  }
88
88
  connectedCallback() {
89
89
  super.connectedCallback();
90
- setTimeout(() => {
90
+ this.updateComplete.then(() => {
91
91
  this.$ripple.attach(this);
92
92
  });
93
93
  this.addEventListener('pointerdown', this.#handlePointerDown);