Contact emails
Explainer
https://docs.google.com/document/d/1UrwLarU-o_-22OMddCH-fu5YJwmIKHwby3SR3_jQ9YM
Summary
This feature is a read-only property for <input> elements presently called "rawValue" (naming currently in discussion). input.rawValue returns the actual text inside of textual input elements, as opposed to the sanitized value returned in the value property. For example, if a user enters "1234ee" into an <input type=number>, the rawValue property would return "1234ee," as opposed to the value property which returns an empty string.
Motivation
Currently, there is no way to retrieve the actual text a user has entered into certain types of input elements due to the sanitization that occurs when accessing the value property, particularly on the number and email input types. Without the ability to do this, virtual DOM framework authors are forced to guess what text the user entered to avoid clearing the text or selection when assigning to the value property. It doesn't work perfectly, and they have to chase down bugs by adding more and more logic on top of input elements.
Risks
Interoperability and Compatibility
There are no specs, implementations, or tests of this feature yet, and there have not been any comments from other browsers yet.
This feature will be detectable by looking for the presence of the rawValue property on input elements which support it.
I have not reached out to other browsers directly yet, but I made a spec issue to drive more discussion here: https://github.com/whatwg/html/issues/5257
Edge: No signals
Firefox: No signals
Safari: No signals
Web / Framework developers: React developers are supportive, web developers are interested in the problem this could solve as shown in the bug links in the explainer
Ergonomics
This new property will be similar to the .value property, and for certain input types it would return the same value.
I don't have any performance concerns with this new API.
Activation
It should be relatively easy for developers to take advantage of this feature.
There does not appear to be a way to polyfill this feature.
Documentation on MDN would be good, but I don't think that significant outreach would be needed.
I don't think libraries will be needed to be built on top of rawValue, but usage in frameworks is important.
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes
Link to entry on the feature dashboard
Requesting approval to ship?
No. I will add this feature as a prototype behind a flag.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAK6btw%2BTYPMccFxf3t_92Znhe4d94J5HZuwDGwe1GpKv5zXGmA%40mail.gmail.com.
Maybe add input.valueType (in addition to input.type) and frameworks will use that instead of type and this way they could get the raw input (because the type will be text) and the browser will treat the field as its valueType? Just thinking out loud...
On Thu, Feb 6, 2020 at 1:22 AM Joey Arhar <jar...@chromium.org> wrote:Motivation
Currently, there is no way to retrieve the actual text a user has entered into certain types of input elements due to the sanitization that occurs when accessing the value property, particularly on the number and email input types. Without the ability to do this, virtual DOM framework authors are forced to guess what text the user entered to avoid clearing the text or selection when assigning to the value property. It doesn't work perfectly, and they have to chase down bugs by adding more and more logic on top of input elements.