-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disallow letter inputs in all number fields #470
base: main
Are you sure you want to change the base?
Disallow letter inputs in all number fields #470
Conversation
Disallow all the character inputs in all the number fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to allow html inputs that are floats (as in have decimal points) you need to add a step
attribute - something like step="0.01"
- you probably also want to add min="0"
so the numbers can only be positive
…input field. Also added the "min" property to allow positive number in input field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! While it works, the app seems to get laggy when you enter the price in Buy/Sell Limit
Further, are there any other fields where we would need to make this adjustment? Maybe on the Create page?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm 👍
@@ -90,7 +90,7 @@ export default function BuyLimit(props: { | |||
const nbrOptions = parseFloat(value) | |||
if (!isNaN(nbrOptions)) { | |||
setNumberOfOptions(nbrOptions) | |||
if (pricePerOption > 0 && nbrOptions > 0) { | |||
if (pricePerOption > 0 && nbrOptions > 0.0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't change anything
Currently, all the number fields on the trade page accept the characters. This PR covered disallowing all the character inputs in all the number fields.
Technical Description
PR Checklist
Screenshots / Screen-recordings