Do you want to request a feature or report a bug?
bug
What is the current behavior?
Given: input field type='email'
When: type valid email address , after type 褋yrillic letter ([email protected] and type '写' (for test you can copy - paste it) )
Then: as a result , we have '[email protected]' and cursor in the start of input field
What is the expected behavior?
[email protected]写 in input field , which i can change
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
react version:16.3.1, browser: chrome 66
simple example https://codesandbox.io/s/3rrzz3qk6
same issue
"react": "15.6.2"
It's Punycode parsing of 褋yrillic letter in email
for example, if try to copypast from browser url 泻芯褕泻邪.褉褎 it become xn--80atap4c.xn--p1ai
so i think value mutable is not a bug
BUT at some moment input set cursor to the start, and sometimes input mutable value sometimes not.
I have tested it with the native input element. The example page: https://codepen.io/Alex1990/pen/BVoKVz?editors=1010.
In Chrome 66, the letter '写' will be encoded. But, in Firefox 60 and Safari 11, the letter will NOT be encoded.
If I convert the event.target.value to its unicode format manually with punycode.toUnicode() method, then all things will be as expected. See this example: https://codesandbox.io/s/mjop6yp37y
Also, you can use type="text" input and add the email validation by yourself.
Personally, I think this is a Chrome bug, or feature 馃槃.
Thanks for additional research! I think it's resolved.
Most helpful comment
I have tested it with the native input element. The example page: https://codepen.io/Alex1990/pen/BVoKVz?editors=1010.
In Chrome 66, the letter '写' will be encoded. But, in Firefox 60 and Safari 11, the letter will NOT be encoded.
If I convert the
event.target.valueto its unicode format manually withpunycode.toUnicode()method, then all things will be as expected. See this example: https://codesandbox.io/s/mjop6yp37yAlso, you can use
type="text"input and add the email validation by yourself.Personally, I think this is a Chrome bug, or feature 馃槃.