Skip to content

Commit

Permalink
fix(VPagination): display length if maxButtons is less than 1
Browse files Browse the repository at this point in the history
fixes #8558
  • Loading branch information
johnleider committed Sep 5, 2019
1 parent a8c3f2a commit 7f7391d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/vuetify/src/components/VPagination/VPagination.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ export default mixins(Colorable, Themeable).extend({
const maxLength = totalVisible > this.maxButtons
? this.maxButtons
: totalVisible || this.maxButtons
if (this.length <= maxLength) {

if (this.length <= maxLength || maxLength < 1) {
return this.range(1, this.length)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,13 @@ describe('VPagination.ts', () => {

expect(wrapper.vm.items).toHaveLength(10)
})

it('should return length when maxButtons is less than 1', () => {
const wrapper = mountFunction({
data: () => ({ maxButtons: -3 }),
propsData: { length: 4 },
})

expect(wrapper.vm.items).toEqual([1, 2, 3, 4])
})
})

0 comments on commit 7f7391d

Please sign in to comment.