@rolster/react-components 18.15.10 → 18.15.12
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,24 +2093,13 @@ 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
2096
|
if (changeInternal.current) {
|
|
2103
2097
|
changeInternal.current = false;
|
|
2104
2098
|
return;
|
|
2105
2099
|
}
|
|
2106
|
-
refresh(collection.current, formControl?.value);
|
|
2107
|
-
}, [formControl?.value]);
|
|
2108
|
-
useEffect(() => {
|
|
2109
2100
|
collection.current = new ListCollection(suggestions);
|
|
2110
|
-
if (!initializedCollection.current || !initializedState.current) {
|
|
2111
|
-
initializedCollection.current = true;
|
|
2112
|
-
return;
|
|
2113
|
-
}
|
|
2114
2101
|
refresh(collection.current, formControl?.value);
|
|
2115
|
-
}, [suggestions]);
|
|
2102
|
+
}, [suggestions, formControl?.value]);
|
|
2116
2103
|
function refresh(collection, state) {
|
|
2117
2104
|
if (!state) {
|
|
2118
2105
|
return refreshProtected(collection) ? undefined : setValue('');
|
|
@@ -2160,7 +2147,7 @@ function useListControl({ suggestions, formControl }) {
|
|
|
2160
2147
|
event: event,
|
|
2161
2148
|
list: listRef.current
|
|
2162
2149
|
});
|
|
2163
|
-
position.current = newPosition
|
|
2150
|
+
position.current = newPosition ?? 0;
|
|
2164
2151
|
}
|
|
2165
2152
|
}
|
|
2166
2153
|
function navigationElement(event) {
|