New issue
Advanced search Search tips

Issue 694391 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug-Regression



Sign in to add a comment

<input type="number"> doesn't allow non-Latin digits (such as ٠١٢٣٤٥٦٧٨٩)

Reported by img...@gmail.com, Feb 21 2017

Issue description

component: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

 
numbers.html
767 bytes View Download

Comment 1 by tkent@chromium.org, Feb 21 2017

Components: -Blink>Forms Blink>Forms>Number
Labels: Needs-Feedback
What's your Chrome UI language?  I think Arabic digits are accepted if Chrome UI language is Arabic.

Comment 2 by img...@gmail.com, 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.
Labels: Needs-Triage-M58
Cc: tkent@chromium.org
Labels: -Needs-Feedback
Thank you for providing feedback. removing "Needs-Feedback" label.

Comment 5 by ajha@chromium.org, Mar 2 2017

Cc: -tkent@chromium.org ajha@chromium.org
Labels: -Type-Bug -Pri-2 M-58 hasbisect OS-Linux OS-Mac Pri-1 Type-Bug-Regression
Owner: tkent@chromium.org
Status: Assigned (was: Unconfirmed)
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!


Comment 6 by tkent@chromium.org, Mar 3 2017

Labels: -Needs-Triage-M58 Needs-Feedback
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?

Comment 7 by img...@gmail.com, 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.

Comment 8 by tkent@chromium.org, Mar 5 2017

Labels: -Pri-1 -Needs-Feedback -Arch-x86_64 Pri-2
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.


Comment 9 by tkent@chromium.org, Mar 7 2017

Status: Started (was: Assigned)
Labels: Merge-Request-58
Status: Fixed (was: Started)
Project Member

Comment 12 by sheriffbot@chromium.org, Mar 8 2017

Labels: -Merge-Request-58 Hotlist-Merge-Approved Merge-Approved-58
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

Comment 13 by img...@gmail.com, 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?
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.

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!

Comment 16 by tkent@chromium.org, Mar 12 2017

Labels: -Merge-Approved-58 merge-merged-3029
Merged to M58.
https://chromium.googlesource.com/chromium/src/+/bf33f15f9b05b7d407347b2a17f91c430dbab35f

Comment 17 by ajha@chromium.org, Mar 14 2017

Labels: TE-Verified-M58 TE-Verified-58.0.3029.19
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