PDA

View Full Version : NumberField doc say Strings are returned from the onChange event



paul.morrissey
17 Jan 2018, 4:14 PM
From the docs I thought I could swap a NumberField for a TextField in order to get a numeric keyboard to display on an Android touch device. Switching to the NumberField did show me the keyboard layout I was expecting, but my code was expecting the onChange event to return a String for the new value, which was true for TextField but NumberField returned a number, even thought the doc says it should have returned a String.

My ultimate solution was to use a TextField with inputType='number'. I now get the keyboard layout I want with a String being returned from onChange.

tristan.lee
17 Jan 2018, 4:39 PM
Looks like a documentation inheritance issue since the value does get transformed into a Number. Would calling value.toString() not be sufficient enough for your case?