@zag-js/pin-input 1.3.1 → 1.3.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/dist/index.js +4 -2
- package/dist/index.mjs +4 -2
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -397,11 +397,13 @@ var machine = createMachine({
|
|
|
397
397
|
const value = fill(event.value, context.get("count"));
|
|
398
398
|
context.set("value", value);
|
|
399
399
|
},
|
|
400
|
-
setFocusedValue({ context, event, computed }) {
|
|
400
|
+
setFocusedValue({ context, event, computed, flush }) {
|
|
401
401
|
const focusedValue = computed("focusedValue");
|
|
402
402
|
const focusedIndex = context.get("focusedIndex");
|
|
403
403
|
const value = getNextValue(focusedValue, event.value);
|
|
404
|
-
|
|
404
|
+
flush(() => {
|
|
405
|
+
context.set("value", utils.setValueAtIndex(computed("_value"), focusedIndex, value));
|
|
406
|
+
});
|
|
405
407
|
},
|
|
406
408
|
revertInputValue({ context, computed, scope }) {
|
|
407
409
|
const inputEl = getInputElAtIndex(scope, context.get("focusedIndex"));
|
package/dist/index.mjs
CHANGED
|
@@ -395,11 +395,13 @@ var machine = createMachine({
|
|
|
395
395
|
const value = fill(event.value, context.get("count"));
|
|
396
396
|
context.set("value", value);
|
|
397
397
|
},
|
|
398
|
-
setFocusedValue({ context, event, computed }) {
|
|
398
|
+
setFocusedValue({ context, event, computed, flush }) {
|
|
399
399
|
const focusedValue = computed("focusedValue");
|
|
400
400
|
const focusedIndex = context.get("focusedIndex");
|
|
401
401
|
const value = getNextValue(focusedValue, event.value);
|
|
402
|
-
|
|
402
|
+
flush(() => {
|
|
403
|
+
context.set("value", setValueAtIndex(computed("_value"), focusedIndex, value));
|
|
404
|
+
});
|
|
403
405
|
},
|
|
404
406
|
revertInputValue({ context, computed, scope }) {
|
|
405
407
|
const inputEl = getInputElAtIndex(scope, context.get("focusedIndex"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/pin-input",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"description": "Core logic for the pin-input widget implemented as a state machine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"url": "https://github.com/chakra-ui/zag/issues"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@zag-js/
|
|
30
|
-
"@zag-js/
|
|
31
|
-
"@zag-js/
|
|
32
|
-
"@zag-js/
|
|
33
|
-
"@zag-js/
|
|
29
|
+
"@zag-js/dom-query": "1.3.3",
|
|
30
|
+
"@zag-js/anatomy": "1.3.3",
|
|
31
|
+
"@zag-js/core": "1.3.3",
|
|
32
|
+
"@zag-js/types": "1.3.3",
|
|
33
|
+
"@zag-js/utils": "1.3.3"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"clean-package": "2.2.0"
|