Closed ebma closed 3 years ago
I moved the new utility functions to a new file and created a new function called FormBigNumber()
which should be used instead of BigNumber()
whenever we are instantiating a Big with user input.
And I also changed the regex such that .xx
or ,xx
are also accepted.
Fixes issues on iOS where the user was unable to enter a valid amount because the on-screen keyboard only showed a comma which was not accepted by the validation mechanism (when the device is set up for EU regions).
Seems like this issue appears on iOS only. When entering a value with a comma into the input field (either the primary amount or manual price, does not matter) it is not propagated correctly, i.e. the onChange event only contains
""
. Removing thetype: "number"
prop helps here, but this is not enough asBig.js
somehow still has issues with the comma string and throws anInvalid number
error when trying to instantiate a newBig()
. That's where thereplaceCommaWithDot(input:string)
function comes into play.Also closes #1251 by re-introducing the validation rule such that the price input field will already show an "Invalid amount" error instead of first showing it when the user clicks on the submit button.