Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why shouldn't a user/agent be able to select an email address or a number?

Chrome has rolled out a change to number inputs that is causing this error in my tests

Uncaught InvalidStateError: Failed to read the 'selectionStart' property from 'HTMLInputElement': The input element's type ('number') does not support selection

I want to understand why should a number/email input not be select-able (sic)?

like image 338
Peter Avatar asked Mar 04 '14 12:03

Peter


1 Answers

Because the standard defines so. http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary

We have no ways to get precise display values of type=email and type=number because of IDNA, value sanitization, and localization. So setting/getting selection information makes no sense.

like image 154
int32_t Avatar answered Oct 04 '22 03:10

int32_t