Skip to content

Commit 6819440

Browse files
committed
fix(primefaces#5577): Use event.key instead of event.code for determining digits
1 parent 8365a30 commit 6819440

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/lib/inputnumber/InputNumber.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ export default {
535535
const isDecimalSign = this.isDecimalSign(char);
536536
const isMinusSign = this.isMinusSign(char);
537537
538-
if (((event.code.startsWith('Digit') || event.code.startsWith('Numpad')) && Number(char) >= 0 && Number(char) <= 9) || isMinusSign || isDecimalSign) {
538+
if (['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'].includes(char) || isMinusSign || isDecimalSign) {
539539
this.insert(event, char, { isDecimalSign, isMinusSign });
540540
}
541541

0 commit comments

Comments
 (0)