@zag-js/combobox 1.3.2 → 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 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
- const { selectionStart, selectionEnd } = inputEl;
1269
- if (Math.abs((selectionEnd ?? 0) - (selectionStart ?? 0)) !== 0) return;
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
- const { selectionStart, selectionEnd } = inputEl;
1267
- if (Math.abs((selectionEnd ?? 0) - (selectionStart ?? 0)) !== 0) return;
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.2",
3
+ "version": "1.3.3",
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.3.2",
30
- "@zag-js/aria-hidden": "1.3.2",
31
- "@zag-js/collection": "1.3.2",
32
- "@zag-js/core": "1.3.2",
33
- "@zag-js/dismissable": "1.3.2",
34
- "@zag-js/dom-query": "1.3.2",
35
- "@zag-js/utils": "1.3.2",
36
- "@zag-js/popper": "1.3.2",
37
- "@zag-js/types": "1.3.2"
29
+ "@zag-js/aria-hidden": "1.3.3",
30
+ "@zag-js/core": "1.3.3",
31
+ "@zag-js/dom-query": "1.3.3",
32
+ "@zag-js/utils": "1.3.3",
33
+ "@zag-js/popper": "1.3.3",
34
+ "@zag-js/types": "1.3.3",
35
+ "@zag-js/anatomy": "1.3.3",
36
+ "@zag-js/collection": "1.3.3",
37
+ "@zag-js/dismissable": "1.3.3"
38
38
  },
39
39
  "devDependencies": {
40
40
  "clean-package": "2.2.0"