Skip to content

Commit

Permalink
Pagination: use setCurrentValue when reassigning input value (#11608)
Browse files Browse the repository at this point in the history
* Pagination:  input bug

currentValue in input component's data object didn't refresh when changeHandle emited

* Update pagination.js
  • Loading branch information
mengro authored and Leopoldthecoder committed Jun 15, 2018
1 parent 48c7bcc commit 23a2e8d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/pagination/src/pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,15 +253,16 @@ export default {
const num = parseInt(value, 10);
if (!isNaN(num)) {
if (num < 1) {
this.$refs.input.$el.querySelector('input').value = 1;
this.$refs.input.setCurrentValue(1);
} else {
this.reassignMaxValue(value);
}
}
},
reassignMaxValue(value) {
if (+value > this.$parent.internalPageCount) {
this.$refs.input.$el.querySelector('input').value = this.$parent.internalPageCount;
var internalPageCount = this.$parent.internalPageCount;
if (+value > internalPageCount) {
this.$refs.input.setCurrentValue(internalPageCount);
}
}
},
Expand Down

0 comments on commit 23a2e8d

Please sign in to comment.