Skip to content

Commit

Permalink
fix(VDataTable): remove page clamp on initial render
Browse files Browse the repository at this point in the history
fixes #17966
closes #20185
  • Loading branch information
KaelWD committed Oct 17, 2024
1 parent 488fc02 commit 60bc70e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { useProxiedModel } from '@/composables/proxiedModel'

// Utilities
import { computed, inject, provide, watch, watchEffect } from 'vue'
import { computed, inject, provide, watch } from 'vue'
import { clamp, getCurrentInstance, propsFactory } from '@/util'

// Types
Expand Down Expand Up @@ -73,7 +73,8 @@ export function providePagination (options: {
return Math.ceil(itemsLength.value / itemsPerPage.value)
})

watchEffect(() => {
// Don't run immediately, items may not have been loaded yet: #17966
watch([page, pageCount], () => {
if (page.value > pageCount.value) {
page.value = pageCount.value
}
Expand Down

0 comments on commit 60bc70e

Please sign in to comment.