@zag-js/combobox 1.3.2 → 1.4.0
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 +3 -5
- package/dist/index.mjs +4 -6
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -1260,15 +1260,13 @@ var machine = core.createMachine({
|
|
|
1260
1260
|
}
|
|
1261
1261
|
});
|
|
1262
1262
|
},
|
|
1263
|
-
syncInputValue({ context, scope }) {
|
|
1263
|
+
syncInputValue({ context, scope, event }) {
|
|
1264
1264
|
const inputEl = getInputEl(scope);
|
|
1265
1265
|
if (!inputEl) return;
|
|
1266
1266
|
inputEl.value = context.get("inputValue");
|
|
1267
1267
|
queueMicrotask(() => {
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
if (selectionStart !== 0) return;
|
|
1271
|
-
inputEl.setSelectionRange(inputEl.value.length, inputEl.value.length);
|
|
1268
|
+
if (event.current().type === "INPUT.CHANGE") return;
|
|
1269
|
+
domQuery.setCaretToEnd(inputEl);
|
|
1272
1270
|
});
|
|
1273
1271
|
},
|
|
1274
1272
|
setInputValue({ context, event }) {
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createAnatomy } from '@zag-js/anatomy';
|
|
2
2
|
import { ListCollection } from '@zag-js/collection';
|
|
3
|
-
import { raf, observeAttributes, observeChildren, clickIfLink, scrollIntoView, query, dataAttr, ariaAttr, isDownloadingEvent, isOpeningInNewTab, isContextMenuEvent, getEventKey, isLeftClick, isComposingEvent, isAnchorElement } from '@zag-js/dom-query';
|
|
3
|
+
import { raf, setCaretToEnd, observeAttributes, observeChildren, clickIfLink, scrollIntoView, query, dataAttr, ariaAttr, isDownloadingEvent, isOpeningInNewTab, isContextMenuEvent, getEventKey, isLeftClick, isComposingEvent, isAnchorElement } from '@zag-js/dom-query';
|
|
4
4
|
import { getPlacement, getPlacementStyles } from '@zag-js/popper';
|
|
5
5
|
import { match, remove, addOrRemove, isBoolean, isEqual, createSplitProps, ensure } from '@zag-js/utils';
|
|
6
6
|
import { ariaHidden } from '@zag-js/aria-hidden';
|
|
@@ -1258,15 +1258,13 @@ var machine = createMachine({
|
|
|
1258
1258
|
}
|
|
1259
1259
|
});
|
|
1260
1260
|
},
|
|
1261
|
-
syncInputValue({ context, scope }) {
|
|
1261
|
+
syncInputValue({ context, scope, event }) {
|
|
1262
1262
|
const inputEl = getInputEl(scope);
|
|
1263
1263
|
if (!inputEl) return;
|
|
1264
1264
|
inputEl.value = context.get("inputValue");
|
|
1265
1265
|
queueMicrotask(() => {
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
if (selectionStart !== 0) return;
|
|
1269
|
-
inputEl.setSelectionRange(inputEl.value.length, inputEl.value.length);
|
|
1266
|
+
if (event.current().type === "INPUT.CHANGE") return;
|
|
1267
|
+
setCaretToEnd(inputEl);
|
|
1270
1268
|
});
|
|
1271
1269
|
},
|
|
1272
1270
|
setInputValue({ context, event }) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/combobox",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Core logic for the combobox widget implemented as a state machine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -26,15 +26,15 @@
|
|
|
26
26
|
"url": "https://github.com/chakra-ui/zag/issues"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@zag-js/anatomy": "1.
|
|
30
|
-
"@zag-js/aria-hidden": "1.
|
|
31
|
-
"@zag-js/collection": "1.
|
|
32
|
-
"@zag-js/core": "1.
|
|
33
|
-
"@zag-js/dismissable": "1.
|
|
34
|
-
"@zag-js/dom-query": "1.
|
|
35
|
-
"@zag-js/utils": "1.
|
|
36
|
-
"@zag-js/popper": "1.
|
|
37
|
-
"@zag-js/types": "1.
|
|
29
|
+
"@zag-js/anatomy": "1.4.0",
|
|
30
|
+
"@zag-js/aria-hidden": "1.4.0",
|
|
31
|
+
"@zag-js/collection": "1.4.0",
|
|
32
|
+
"@zag-js/core": "1.4.0",
|
|
33
|
+
"@zag-js/dismissable": "1.4.0",
|
|
34
|
+
"@zag-js/dom-query": "1.4.0",
|
|
35
|
+
"@zag-js/utils": "1.4.0",
|
|
36
|
+
"@zag-js/popper": "1.4.0",
|
|
37
|
+
"@zag-js/types": "1.4.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"clean-package": "2.2.0"
|