Merge pull request #5578 from csaba215/fix-5577

fix(#5577): Use event.key instead of event.code for determining digits
pull/5617/head
Tuğçe Küçükoğlu 2024-04-19 11:50:23 +03:00 committed by GitHub
commit 8523ff27f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -535,7 +535,7 @@ export default {
const isDecimalSign = this.isDecimalSign(char); const isDecimalSign = this.isDecimalSign(char);
const isMinusSign = this.isMinusSign(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 }); this.insert(event, char, { isDecimalSign, isMinusSign });
} }