<input type="number"> doesn't allow non-Latin digits (such as ٠١٢٣٤٥٦٧٨٩)
Reported by
img...@gmail.com,
Feb 21 2017
|
|||||||||||
Issue descriptioncomponent:Blink>Forms>Number UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3018.0 Safari/537.36 Steps to reproduce the problem: 1. Try to type or paste non-latin digits into <input type="number"> (such as ٠١٢٣٤٥٦٧٨٩ , which are the Arabic digits for 0123456789). 2. Chrome does not allow them to be typed or pasted. What is the expected behavior? They should be accepted as input, and `input.value` should return their equivalent numeric value (for example, ٠١٢٣٤٥٦٧٨٩ should be 123456789). What went wrong? Chrome does not accept any characters in <input type="number"> other than `0123456789.-+e`. There are digits in other languages other than Latin which should also be accepted. A list can be found on Wikipedia: https://en.wikipedia.org/wiki/Hindu%E2%80%93Arabic_numeral_system#Glyph_comparison Did this work before? No Does this work in other browsers? No Firefox: Works correctly. Allows non-Latin digits in <input type="number"> and return the correct numeric value in `input.value`. IE, Edge, Safari: Same behavior as Chrome. Does not allow non-Latin digits. Chrome version: 58.0.3018.0 Channel: canary OS Version: 10.0 Flash Version: Shockwave Flash 24.0 r0
,
Feb 21 2017
No. I changed the Chrome UI language to Arabic and they're still not accepted. Actually, I think they should be accepted regardless of the browser or OS language. Many users are bilingual and may prefer to have the UI in English, and at the same time fill a form while the keyboard is set to another language.
,
Feb 23 2017
,
Mar 1 2017
Thank you for providing feedback. removing "Needs-Feedback" label.
,
Mar 2 2017
Able to reproduce the issue on the latest canary(58.0.3028.0/58.0.3027.3) and the latest stable(56.0.2924.87) on Windows-10, Mac OS 10.12.3 and Linux Ubuntu 14.04. Changing the Chrome UI language to arabic also doesn't accept the copied text. Regressed in M-44. Last good build: 44.0.2378.0 First bad build: 44.0.2379.0 Changelog: https://chromium.googlesource.com/chromium/src/+log/581222c25bb9b1c435be50bb9d434bef564f02c5..11e724cae6142ebb800a796fc8d4d36f0aa55c68 Blink changelog: https://chromium.googlesource.com/chromium/blink/+log/869bde4..40dd7d5 Suspecting: https://codereview.chromium.org/1100273002 tkent@: Could you please take a look at this. Thank you!
,
Mar 3 2017
I still can't reproduce this. With chrome in Arabic (chrome.exe --lang=ar), the following URL shows "١٠٢٤" expectedly, and I can paste Arabic digits into the number field. I don't know how to type them with a keyboard. data:text/html,<input type="number" value="1024"> imgx64@, does <input type=number value=1024> show Arabic digits in your environment?
,
Mar 5 2017
Oddly enough, yes, it shows Arabic digits, and it even accepts them as input. But it's still buggy. For some reason, if `value` is not set, it doesn't work. But if you set the value (with HTML or programatically) to *any* `number` input in the page, all the number inputs in the tab start to accept Arabic digits. And they keep working even if you go to another page, until you close that tab. That's definitely a bug. However, that only works when the Chrome UI language is Arabic. As I've explained above in Comment 2, they should be always accepted regardless of UI language. In our experience, most bilingual users have the UI in English and only switch the keyboard language when needed.
,
Mar 5 2017
Aha, I understand the root cause of the issue. We miss to initialize localized digits data while keyboard input processing though it is initialized while showing localized digits. I'll fix this.
,
Mar 7 2017
,
Mar 7 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/627d462e4a1fb99efa5d66caf6648a5cb246ffa6 commit 627d462e4a1fb99efa5d66caf6648a5cb246ffa6 Author: tkent <tkent@chromium.org> Date: Tue Mar 07 23:28:46 2017 <input type=number>: accept localized digits without showing them. Locale::stripInvalidNumberCharacters() missed to call initializeLocaleData(). BUG= 694391 Review-Url: https://codereview.chromium.org/2738463003 Cr-Commit-Position: refs/heads/master@{#455286} [modify] https://crrev.com/627d462e4a1fb99efa5d66caf6648a5cb246ffa6/third_party/WebKit/Source/platform/BUILD.gn [modify] https://crrev.com/627d462e4a1fb99efa5d66caf6648a5cb246ffa6/third_party/WebKit/Source/platform/text/PlatformLocale.cpp [modify] https://crrev.com/627d462e4a1fb99efa5d66caf6648a5cb246ffa6/third_party/WebKit/Source/platform/text/PlatformLocale.h [add] https://crrev.com/627d462e4a1fb99efa5d66caf6648a5cb246ffa6/third_party/WebKit/Source/platform/text/PlatformLocaleTest.cpp
,
Mar 8 2017
,
Mar 8 2017
Your change meets the bar and is auto-approved for M58. Please go ahead and merge the CL to branch 3029 manually. Please contact milestone owner if you have questions. Owners: amineer@(clank), cmasso@(bling), bhthompson@(cros), govind@(desktop) For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Mar 9 2017
@tkent , this fix only applies when Chrome's UI language is Arabic, which is a secondary bug and is *not* the issue reported here. This issue is about making non-latin digits work regardless of UI language. The original bug report did not mention the UI language at all because it didn't seem important. After all, in a number context, "٤" has no meaning other than "4", so there's no reason to disallow it. We actually have users who complained that they couldn't type in some input fields. Their UI language is English, their keyboard language is Arabic and they were trying to type into an <input type="number"> on an Arabic page. What do you suggest we do in this case? We ended up using <input type="tel"> and converting the digits in JavaScript, which just feels like a hack. Is such fix worth implementing or do you think it's a WontFix? If you think it's undesirable, can it at least be implemented when the page has <html lang="ar"> or something?
,
Mar 9 2017
We don't have a plan to change the current design. However, we'd like to make form controls lang-attribute-aware. It's Issue 141169.
,
Mar 12 2017
Please merge your change to M58 branch 3029 before 5:00 PM PT, Monday (03/13/17) so we can take it in for next week dev release. Thank you!
,
Mar 12 2017
Merged to M58. https://chromium.googlesource.com/chromium/src/+/bf33f15f9b05b7d407347b2a17f91c430dbab35f
,
Mar 14 2017
Verified the fix on the latest M-58(58.0.3029.19) on Windows-10,Mac OS 10.12.3 and Linux Ubuntu 14.04. Able to paste the content into the text box as per the attached test file(numbers.html). Works only when the Chrome UI language is Arabic. Adding the verified label. |
|||||||||||
►
Sign in to add a comment |
|||||||||||
Comment 1 by tkent@chromium.org
, Feb 21 2017Labels: Needs-Feedback