@rolster/react-components 18.21.6 → 18.21.8

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/es/index.js CHANGED
@@ -2434,7 +2434,9 @@ function useListController(props) {
2434
2434
  element && setFormValue(element);
2435
2435
  }
2436
2436
  else {
2437
- automatic && setFormValue(collection.value[0], true);
2437
+ automatic
2438
+ ? setFormValue(collection.value[0], true)
2439
+ : refreshState({ ...state, value: '' });
2438
2440
  }
2439
2441
  }
2440
2442
  changeValueInternal.current = false;
@@ -2577,14 +2579,14 @@ function useFieldAutocomplete(props) {
2577
2579
  return () => {
2578
2580
  onChange(element);
2579
2581
  };
2580
- }, []);
2582
+ }, [onChange]);
2581
2583
  const onKeydownElement = useCallback((element) => {
2582
2584
  return (event) => {
2583
2585
  event.code === 'Enter'
2584
2586
  ? onChange(element)
2585
2587
  : controller.navigationElement(event);
2586
2588
  };
2587
- }, [controller.navigationElement]);
2589
+ }, [onChange, controller.navigationElement]);
2588
2590
  return {
2589
2591
  ...controller,
2590
2592
  coincidences,
@@ -2965,14 +2967,14 @@ function useFieldSelect(props) {
2965
2967
  return () => {
2966
2968
  onChange(element);
2967
2969
  };
2968
- }, []);
2970
+ }, [onChange]);
2969
2971
  const onKeydownElement = useCallback((element) => {
2970
2972
  return (event) => {
2971
2973
  event.code === 'Enter'
2972
2974
  ? onChange(element)
2973
2975
  : controller.navigationElement(event);
2974
2976
  };
2975
- }, [controller.navigationElement]);
2977
+ }, [onChange, controller.navigationElement]);
2976
2978
  return {
2977
2979
  ...controller,
2978
2980
  onBlurInput,