diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue
index 0a306dc5f..dfe0e57ab 100644
--- a/src/components/ui/VnFilterPanel.vue
+++ b/src/components/ui/VnFilterPanel.vue
@@ -64,10 +64,12 @@ onMounted(() => {
});
const isLoading = ref(false);
-
async function search() {
isLoading.value = true;
const params = { ...userParams.value };
+ store.userParamsChanged = true;
+ store.filter.skip = 0;
+ store.skip = 0;
const { params: newParams } = await arrayData.addFilter({ params });
userParams.value = newParams;
@@ -89,7 +91,9 @@ async function reload() {
async function clearFilters() {
isLoading.value = true;
-
+ store.userParamsChanged = true;
+ store.filter.skip = 0;
+ store.skip = 0;
// Filtrar los params no removibles
const removableFilters = Object.keys(userParams.value).filter((param) =>
props.unremovableParams.includes(param)
diff --git a/src/components/ui/VnPaginate.vue b/src/components/ui/VnPaginate.vue
index 1aa99ea0c..4c38c1c1a 100644
--- a/src/components/ui/VnPaginate.vue
+++ b/src/components/ui/VnPaginate.vue
@@ -104,6 +104,8 @@ async function paginate() {
await arrayData.loadMore();
if (!arrayData.hasMoreData.value) {
+ if (store.userParamsChanged) arrayData.hasMoreData.value = true;
+ store.userParamsChanged = false;
isLoading.value = false;
return;
}
@@ -129,9 +131,9 @@ async function onLoad(...params) {
pagination.value.page = pagination.value.page + 1;
await paginate();
-
- const endOfPages = !arrayData.hasMoreData.value;
- done(endOfPages);
+ let isDone = false;
+ if (store.userParamsChanged) isDone = !arrayData.hasMoreData.value;
+ done(isDone);
}
@@ -172,7 +174,7 @@ async function onLoad(...params) {
v-if="store.data"
@load="onLoad"
:offset="offset"
- class="full-width full-height overflow-auto"
+ class="full-width full-height"
>