@rolster/react-components 18.15.10 → 18.15.11

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
@@ -2073,8 +2073,6 @@ function useListControl({ suggestions, formControl }) {
2073
2073
  });
2074
2074
  const collection = useRef(new ListCollection([]));
2075
2075
  const position = useRef(0);
2076
- const initializedState = useRef(false);
2077
- const initializedCollection = useRef(false);
2078
2076
  const changeInternal = useRef(false);
2079
2077
  const protectedValue = useRef();
2080
2078
  useEffect(() => {
@@ -2095,11 +2093,7 @@ function useListControl({ suggestions, formControl }) {
2095
2093
  }));
2096
2094
  }, [state.visible]);
2097
2095
  useEffect(() => {
2098
- if (!initializedState.current || !initializedCollection.current) {
2099
- initializedState.current = true;
2100
- return;
2101
- }
2102
- if (changeInternal.current) {
2096
+ if (!changeInternal.current) {
2103
2097
  changeInternal.current = false;
2104
2098
  return;
2105
2099
  }
@@ -2107,10 +2101,6 @@ function useListControl({ suggestions, formControl }) {
2107
2101
  }, [formControl?.value]);
2108
2102
  useEffect(() => {
2109
2103
  collection.current = new ListCollection(suggestions);
2110
- if (!initializedCollection.current || !initializedState.current) {
2111
- initializedCollection.current = true;
2112
- return;
2113
- }
2114
2104
  refresh(collection.current, formControl?.value);
2115
2105
  }, [suggestions]);
2116
2106
  function refresh(collection, state) {