Pagination: add keyup event to jumper so it works in IE11 (#9538)

pull/9543/head
杨奕 2018-01-29 23:12:30 +08:00 committed by GitHub
parent 85a3e99ceb
commit 575e2d1307
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -214,6 +214,11 @@ export default {
this.resetValueIfNeed(target.value);
this.reassignMaxValue(target.value);
},
handleKeyup({ keyCode, target }) {
if (keyCode === 13 && this.oldValue && target.value !== this.oldValue) {
this.handleChange(target.value);
}
},
handleChange(value) {
this.$parent.internalCurrentPage = this.$parent.getValidCurrentPage(value);
this.oldValue = null;
@ -248,6 +253,7 @@ export default {
domPropsValue={ this.$parent.internalCurrentPage }
type="number"
ref="input"
nativeOnKeyup={ this.handleKeyup }
onChange={ this.handleChange }
onFocus={ this.handleFocus }
onBlur={ this.handleBlur }/>