Skip to content

Commit

Permalink
fix(#5577): Use event.key instead of event.code for determining digits
Browse files Browse the repository at this point in the history
  • Loading branch information
csaba215 committed Apr 12, 2024
1 parent 8365a30 commit 6819440
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/lib/inputnumber/InputNumber.vue
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ export default {
const isDecimalSign = this.isDecimalSign(char);
const isMinusSign = this.isMinusSign(char);
if (((event.code.startsWith('Digit') || event.code.startsWith('Numpad')) && Number(char) >= 0 && Number(char) <= 9) || isMinusSign || isDecimalSign) {
if (['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'].includes(char) || isMinusSign || isDecimalSign) {
this.insert(event, char, { isDecimalSign, isMinusSign });
}
Expand Down

0 comments on commit 6819440

Please sign in to comment.