@dev-fastn-ai/react-core 2.2.6 → 2.2.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/index.cjs.js +3 -3
- package/dist/index.esm.js +3 -3
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -2431,7 +2431,7 @@ function useFieldOptions(field) {
|
|
|
2431
2431
|
}, [field.key, field.name]);
|
|
2432
2432
|
// Initial fetch query for static options or first page
|
|
2433
2433
|
const initialQuery = reactQuery.useQuery({
|
|
2434
|
-
queryKey: [...queryKey, "initial"
|
|
2434
|
+
queryKey: [...queryKey, "initial"],
|
|
2435
2435
|
queryFn: async () => {
|
|
2436
2436
|
var _a, _b;
|
|
2437
2437
|
if (!((_a = field.optionsSource) === null || _a === void 0 ? void 0 : _a.getOptions))
|
|
@@ -2515,8 +2515,8 @@ function useFieldOptions(field) {
|
|
|
2515
2515
|
// Search handler
|
|
2516
2516
|
const search = react.useCallback((query) => {
|
|
2517
2517
|
var _a;
|
|
2518
|
-
|
|
2519
|
-
|
|
2518
|
+
if ((_a = initialQuery.data) === null || _a === void 0 ? void 0 : _a.searchable) {
|
|
2519
|
+
// Always use debounced search to prevent rapid state updates
|
|
2520
2520
|
debouncedSetSearch(query);
|
|
2521
2521
|
}
|
|
2522
2522
|
else {
|
package/dist/index.esm.js
CHANGED
|
@@ -2429,7 +2429,7 @@ function useFieldOptions(field) {
|
|
|
2429
2429
|
}, [field.key, field.name]);
|
|
2430
2430
|
// Initial fetch query for static options or first page
|
|
2431
2431
|
const initialQuery = useQuery({
|
|
2432
|
-
queryKey: [...queryKey, "initial"
|
|
2432
|
+
queryKey: [...queryKey, "initial"],
|
|
2433
2433
|
queryFn: async () => {
|
|
2434
2434
|
var _a, _b;
|
|
2435
2435
|
if (!((_a = field.optionsSource) === null || _a === void 0 ? void 0 : _a.getOptions))
|
|
@@ -2513,8 +2513,8 @@ function useFieldOptions(field) {
|
|
|
2513
2513
|
// Search handler
|
|
2514
2514
|
const search = useCallback((query) => {
|
|
2515
2515
|
var _a;
|
|
2516
|
-
|
|
2517
|
-
|
|
2516
|
+
if ((_a = initialQuery.data) === null || _a === void 0 ? void 0 : _a.searchable) {
|
|
2517
|
+
// Always use debounced search to prevent rapid state updates
|
|
2518
2518
|
debouncedSetSearch(query);
|
|
2519
2519
|
}
|
|
2520
2520
|
else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dev-fastn-ai/react-core",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.8",
|
|
4
4
|
"description": "React hooks and components for integrating Fastn AI connector marketplace into your applications. Built on top of @fastn-ai/core with React Query for optimal performance.",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|