I know this is an old question, but I did find a good workaround without using the tel
input type. By changing the input type from number
to text
before the selection, the error goes away and you get to keep all the benefits of the number
input type.
tel
allows text input, which may not work with numbers.tel
does not show the number “spinner” next to the input (only if you want it).
function onInputFocus(event) {
const target = event.currentTarget;
target.type="text";
target.setSelectionRange(0, target.value.length);
target.type="number";
}