From cafeeeebbb0b01ab6aa8513390e145033d9f9788 Mon Sep 17 00:00:00 2001 From: EvanLrC <130769018+EvanLrC@users.noreply.github.com> Date: Tue, 1 Oct 2024 17:07:57 +0200 Subject: [PATCH] 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. --- components/lib/inputnumber/InputNumber.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/lib/inputnumber/InputNumber.vue b/components/lib/inputnumber/InputNumber.vue index 56a4a47c4..07e75e157 100755 --- a/components/lib/inputnumber/InputNumber.vue +++ b/components/lib/inputnumber/InputNumber.vue @@ -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(); }