@djcali570/component-lib 0.1.102 → 0.1.104

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Svelte Component library
2
2
 
3
- 0.1.102
3
+ 0.1.104
4
4
 
5
5
  - Updated Input to trigger onUpdate when cleared.
6
6
 
@@ -64,6 +64,8 @@
64
64
  let inputElement: HTMLInputElement | null = $state(null);
65
65
  let keydownHandler: (e: Event) => void = $state(() => {});
66
66
  let inputHandler: (e: Event) => void = $state(() => {});
67
+ let lastValue: string | undefined = $state(undefined);
68
+ let initialized = $state(false);
67
69
 
68
70
  /**
69
71
  * Regex Validators
@@ -87,7 +89,20 @@
87
89
  });
88
90
 
89
91
  $effect(() => {
90
- onUpdate(value ?? '');
92
+ const current = value ?? '';
93
+
94
+ // 🚫 Skip first run
95
+ if (!initialized) {
96
+ lastValue = current;
97
+ initialized = true;
98
+ return;
99
+ }
100
+
101
+ // ✅ Only fire on real changes
102
+ if (current !== lastValue) {
103
+ lastValue = current;
104
+ onUpdate(current);
105
+ }
91
106
  });
92
107
 
93
108
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djcali570/component-lib",
3
- "version": "0.1.102",
3
+ "version": "0.1.104",
4
4
  "files": [
5
5
  "dist",
6
6
  "!dist/**/*.test.*",