Skip to content

Commit 1b26ea9

Browse files
committed
fix(QIconPicker): adjust available pages when icon set changes
1 parent 2d07a5e commit 1b26ea9

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/component/QIconPicker.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,17 +112,21 @@ export default Vue.extend({
112112
iconSet (val) {
113113
this.loadIconSet(val)
114114
this.updatePagination()
115-
// whenever the icon set changes, it resets pagination page to page 1
116-
this.setPagination({ page: 1 })
115+
this.$nextTick(() => {
116+
// whenever the icon set changes, it resets pagination page to page 1
117+
this.setPagination({ page: 1 })
118+
})
117119
},
118120

119121
icons (val) {
120122
if (this.icons !== void 0 && this.icons.length > 0) {
121123
this.iconsList = this.icons
122124
}
123125
this.updatePagination()
124-
// whenever the icons changes, it resets pagination page to page 1
125-
this.setPagination({ page: 1 })
126+
this.$nextTick(() => {
127+
// whenever the icon set changes, it resets pagination page to page 1
128+
this.setPagination({ page: 1 })
129+
})
126130
},
127131

128132
pagination (newVal, oldVal) {

0 commit comments

Comments
 (0)