hamzus-ui 0.0.65 → 0.0.66

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": "hamzus-ui",
3
- "version": "0.0.65",
3
+ "version": "0.0.66",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "svelte": "index.js",
@@ -33,18 +33,17 @@
33
33
  import { onMount } from 'svelte';
34
34
 
35
35
  // local var
36
+ let isMounted = false
36
37
 
37
- $: {
38
+ $:if(value) {
38
39
  let newValue = formatInput(value);
39
40
 
40
41
  if (newValue !== value) {
41
42
  value = newValue;
42
43
  hasChanged = value != initialValue;
43
- } else if (onChange) {
44
- console.log("in change");
45
-
44
+ }else if (onChange && isMounted) {
46
45
  onChange(value);
47
- }
46
+ }
48
47
  }
49
48
 
50
49
  // fnctions
@@ -89,15 +88,9 @@
89
88
  }
90
89
 
91
90
  onMount(() => {
92
- let newValue = formatInput(value);
93
-
94
- if (newValue !== value) {
95
- value = newValue;
96
- }
97
-
98
- if (formatPattern.length !== 0) {
99
- initialValue = value;
100
- }
91
+ isMounted = false
92
+
93
+ isMounted = true
101
94
  });
102
95
 
103
96
  function handleDisplay() {