11

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)?

Peter
  • 4,493
  • 6
  • 41
  • 64
  • 3
    I concur - especially with a number field. I've posted a question describing this entire issue (and a working workaround solution) here: http://stackoverflow.com/questions/22381837/how-to-overcome-whatwg-w3c-chrome-version-33-0-1750-146-regression-bug-with-i – scunliffe Mar 13 '14 at 15:19

1 Answers1

1

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.

int32_t
  • 5,774
  • 1
  • 22
  • 20
  • 3
    is that any different to a text input? i would say that text is more problematic due to the reasons you have mentioned. at least a number is a number and how would localisation affect an email address? – Peter Mar 05 '14 at 10:07
  • 10
    "Because the standard defines so" is not a good answer for this. It answers why Chrome has implemented this behavior, but the answer to the question should include a description of ***why*** the standard defines so. – awe Apr 30 '14 at 09:29