Skip to content

Commit 88a9845

Browse files
committed
fix: simple Pagination input not work #1333
1 parent 24fd488 commit 88a9845

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

components/vc-pagination/Pagination.jsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,22 +170,21 @@ export default {
170170
event.preventDefault();
171171
}
172172
},
173-
handleKeyUp(event) {
174-
const inputValue = event.target.value;
173+
handleKeyUp(e) {
174+
const value = this.getValidValue(e);
175175
const stateCurrentInputValue = this.stateCurrentInputValue;
176-
let value;
177176

178177
if (value !== stateCurrentInputValue) {
179178
this.setState({
180179
stateCurrentInputValue: value,
181180
});
182181
}
183182

184-
if (event.keyCode === KEYCODE.ENTER) {
183+
if (e.keyCode === KEYCODE.ENTER) {
185184
this.handleChange(value);
186-
} else if (event.keyCode === KEYCODE.ARROW_UP) {
185+
} else if (e.keyCode === KEYCODE.ARROW_UP) {
187186
this.handleChange(value - 1);
188-
} else if (event.keyCode === KEYCODE.ARROW_DOWN) {
187+
} else if (e.keyCode === KEYCODE.ARROW_DOWN) {
189188
this.handleChange(value + 1);
190189
}
191190
},

0 commit comments

Comments
 (0)