@choice-ui/react 1.9.8 → 2.0.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.
@@ -81,11 +81,14 @@ const Command = forwardRef((props, forwardedRef) => {
81
81
  if (input) input.focus();
82
82
  else (_a = document.getElementById(listId)) == null ? void 0 : _a.focus();
83
83
  }
84
- schedule(7, () => {
85
- var _a2;
86
- state.current.selectedItemId = (_a2 = getSelectedItem()) == null ? void 0 : _a2.id;
87
- store.emit();
88
- });
84
+ let newSelectedId;
85
+ for (const [itemId, data] of ids.current.entries()) {
86
+ if (data.value === value2) {
87
+ newSelectedId = itemId;
88
+ break;
89
+ }
90
+ }
91
+ state.current.selectedItemId = newSelectedId;
89
92
  if (!opts) {
90
93
  schedule(5, scrollSelectedIntoView);
91
94
  }
@@ -79,6 +79,7 @@ const CommandItem = memo(
79
79
  const hasValidShortcut = shortcut && (shortcut.modifier || shortcut.keys);
80
80
  const handlePointerMove = useEventCallback(() => {
81
81
  if (disabled || context.getDisablePointerSelection()) return;
82
+ if (context.store.snapshot().value === valueRef.current) return;
82
83
  select();
83
84
  });
84
85
  const handleClick = useEventCallback(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@choice-ui/react",
3
- "version": "1.9.8",
3
+ "version": "2.0.0",
4
4
  "description": "A desktop-first React UI component library built for professional desktop applications with comprehensive documentation",
5
5
  "sideEffects": false,
6
6
  "type": "module",