@unbxd-ui/unbxd-react-components 0.2.138 → 0.2.139
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.
|
@@ -159,7 +159,7 @@ var ServerPaginatedDDList = function ServerPaginatedDDList(props) {
|
|
|
159
159
|
};
|
|
160
160
|
var makeAPICall = function makeAPICall() {
|
|
161
161
|
_dataLoader["default"].abortPreviousCall(requestId);
|
|
162
|
-
|
|
162
|
+
setIsApiLoading(true);
|
|
163
163
|
apiCallRef.current = true;
|
|
164
164
|
setIsNextPageLoading(true);
|
|
165
165
|
if (prefetchedPageResponse && pageNoRef.current === prefetchedPageNo) {
|
|
@@ -198,6 +198,7 @@ var ServerPaginatedDDList = function ServerPaginatedDDList(props) {
|
|
|
198
198
|
/* search query changed -> reset page no. to 1 */
|
|
199
199
|
if (searchQuery !== searchRef.current) {
|
|
200
200
|
// dataLoader.abortPreviousCall(requestId);
|
|
201
|
+
setIsApiLoading(true);
|
|
201
202
|
setIsNextPageLoading(true);
|
|
202
203
|
searchRef.current = searchQuery;
|
|
203
204
|
startSearch();
|
|
@@ -247,12 +248,12 @@ var ServerPaginatedDDList = function ServerPaginatedDDList(props) {
|
|
|
247
248
|
}
|
|
248
249
|
return [];
|
|
249
250
|
}
|
|
250
|
-
|
|
251
|
-
// its not following debounce behaviour
|
|
252
|
-
if (total === 0) {
|
|
251
|
+
if (total === 0 && searchQuery === searchRef.current && !isApiLoading) {
|
|
253
252
|
return /*#__PURE__*/_react["default"].createElement(_NoDataDropdown["default"], _extends({
|
|
254
253
|
searchQuery: searchQuery
|
|
255
254
|
}, restProps));
|
|
255
|
+
} else if (total === 0 && LoaderComponent) {
|
|
256
|
+
return LoaderComponent;
|
|
256
257
|
}
|
|
257
258
|
return /*#__PURE__*/_react["default"].createElement(_reactWindowInfiniteLoader["default"]
|
|
258
259
|
// Function responsible for tracking the loaded state of each item.
|