@canutin/svelte-currency-input 0.9.1 → 0.9.3
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/CurrencyInput.svelte +6 -6
- package/README.md +1 -1
- package/package.json +4 -4
package/CurrencyInput.svelte
CHANGED
|
@@ -103,13 +103,13 @@ const setFormattedValue = () => {
|
|
|
103
103
|
formattedValue = isZero ? '' : formatCurrency(value, fractionDigits, 0);
|
|
104
104
|
// Update `value` after formatting
|
|
105
105
|
setUnformattedValue();
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
106
|
+
let retries = 0;
|
|
107
|
+
while (previousFormattedValueLength === formattedValue.length && retries < 10)
|
|
108
|
+
retries++;
|
|
109
|
+
if (previousFormattedValueLength !== formattedValue.length) {
|
|
110
|
+
const endCaretPosition = startCaretPosition + formattedValue.length - previousFormattedValueLength;
|
|
111
111
|
inputTarget?.setSelectionRange(endCaretPosition, endCaretPosition);
|
|
112
|
-
}
|
|
112
|
+
}
|
|
113
113
|
// Run callback function when `value` changes
|
|
114
114
|
onValueChange(value);
|
|
115
115
|
};
|
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canutin/svelte-currency-input",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3",
|
|
4
4
|
"exports": {
|
|
5
5
|
"./package.json": "./package.json",
|
|
6
6
|
".": "./index.js",
|
|
@@ -39,13 +39,13 @@
|
|
|
39
39
|
],
|
|
40
40
|
"repository": {
|
|
41
41
|
"type": "git",
|
|
42
|
-
"url": "git+https://github.com/
|
|
42
|
+
"url": "git+https://github.com/fmaclen/svelte-currency-input.git"
|
|
43
43
|
},
|
|
44
44
|
"author": "Fernando Maclen <hello@fernando.is>",
|
|
45
45
|
"license": "MIT",
|
|
46
46
|
"bugs": {
|
|
47
|
-
"url": "https://github.com/
|
|
47
|
+
"url": "https://github.com/fmaclen/svelte-currency-input/issues"
|
|
48
48
|
},
|
|
49
|
-
"homepage": "https://github.com/
|
|
49
|
+
"homepage": "https://github.com/fmaclen/svelte-currency-input#readme",
|
|
50
50
|
"svelte": "./index.js"
|
|
51
51
|
}
|