feat/InputNumber: Accept Comma And NumpadDecimal as decimal "sign", only for locale 'fr-FR' ?

As anAZERTY (French) keyboard layout with french localization : having to use the comma is really counter intuitive. Here is a schema for better understanding.

354626602-0ea25181-44d4-44a3-9040-05c44de22ce2

To improve the user experience, it would be desirable to use a Comma (, or ,) to go to the decimal part.
pull/6506/head
EvanLrC 2024-10-01 17:07:57 +02:00 committed by GitHub
parent 508652963a
commit cafeeeebbb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -540,6 +540,11 @@ export default {
let isDecimalSign = this.isDecimalSign(char);
const isMinusSign = this.isMinusSign(char);
if (this.locale === 'fr-FR' && (event.code === 'Comma' || event.code === 'NumpadDecimal') && !isDecimalSign) {
isDecimalSign = true
char = decimalSign
}
if (event.code !== 'Enter') {
event.preventDefault();
}