Getting error message when using number input
I am getting the following error when trying to use a numeric input.
Uncaught DOMException: Failed to execute 'setSelectionRange' on 'HTMLInputElement': The input element's type ('number') does not support selection.
My component call looks like this:
<CurrencyInput
name="customerAllocationMicros"
allowNegative
value={(line.customerAllocationMicros / 1000)}
onChangeEvent={this.updateAllocationLine(index)}
disabled={disableControls}
/>
line is part of an array in my state, and updateAllocationLine takes the index to that array and returns a function that will update the correct array member via setState.
Any ideas?
This is interesting since you're not defining inputType. Can you post a small repo that reproduces the error? That would help me debug this.
Hi, any solution?
Thanks for the reproduction @eseQ. Unfortunately, I haven't used this project in quite some time. If you're able to open a pull request to fix the issue then I can approve it and merge it in, but I won't be able to spend the time to fix the issue myself.
@aesopwolf thanks for the answer. Maybe I can fix it later.
fwiw, number type does not support selection, so specifying inputType to text or tel should work.