myoperator-ui 0.0.173 → 0.0.175-beta.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.
Files changed (2) hide show
  1. package/dist/index.js +9 -11
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2190,18 +2190,14 @@ const SelectField = React.forwardRef<HTMLButtonElement, SelectFieldProps>(
2190
2190
  // Internal state for search
2191
2191
  const [searchQuery, setSearchQuery] = React.useState("");
2192
2192
 
2193
- // Handle value change and call both onValueChange and onSelect
2194
- const handleValueChange = React.useCallback(
2195
- (newValue: string) => {
2196
- onValueChange?.(newValue);
2197
- if (onSelect) {
2198
- const selectedOption = options.find((o) => o.value === newValue);
2199
- if (selectedOption) {
2200
- onSelect(selectedOption);
2201
- }
2193
+ // Handle onSelect at item level (fires even when same value is re-selected)
2194
+ const handleItemSelect = React.useCallback(
2195
+ (option: SelectOption) => {
2196
+ if (!option.disabled) {
2197
+ onSelect?.(option);
2202
2198
  }
2203
2199
  },
2204
- [onValueChange, onSelect, options]
2200
+ [onSelect]
2205
2201
  );
2206
2202
 
2207
2203
  // Derive state from props
@@ -2278,7 +2274,7 @@ const SelectField = React.forwardRef<HTMLButtonElement, SelectFieldProps>(
2278
2274
  <Select
2279
2275
  value={value}
2280
2276
  defaultValue={defaultValue}
2281
- onValueChange={handleValueChange}
2277
+ onValueChange={onValueChange}
2282
2278
  disabled={disabled || loading}
2283
2279
  name={name}
2284
2280
  onOpenChange={handleOpenChange}
@@ -2319,6 +2315,7 @@ const SelectField = React.forwardRef<HTMLButtonElement, SelectFieldProps>(
2319
2315
  key={option.value}
2320
2316
  value={option.value}
2321
2317
  disabled={option.disabled}
2318
+ onPointerUp={() => handleItemSelect(option)}
2322
2319
  >
2323
2320
  {option.label}
2324
2321
  </SelectItem>
@@ -2335,6 +2332,7 @@ const SelectField = React.forwardRef<HTMLButtonElement, SelectFieldProps>(
2335
2332
  key={option.value}
2336
2333
  value={option.value}
2337
2334
  disabled={option.disabled}
2335
+ onPointerUp={() => handleItemSelect(option)}
2338
2336
  >
2339
2337
  {option.label}
2340
2338
  </SelectItem>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myoperator-ui",
3
- "version": "0.0.173",
3
+ "version": "0.0.175-beta.0",
4
4
  "description": "CLI for adding myOperator UI components to your project",
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",