This repository was archived by the owner on Feb 23, 2021. It is now read-only.
This repository was archived by the owner on Feb 23, 2021. It is now read-only.
AmountInputField behaviour not constrained #615
Open
Description
Description
Various undesired states can be created in the amount input field.
-
Negative amount
-
Multiple leading zeros
-
More than two decimals
-
Label gets too large
-
Entering
0-
- Multiple dots
...4
Steps to reproduce the behavior
Using Lightning-linux-x86_64v0.2.0-prealpha.25.AppImage
- Go to payment request screen
- Enter invalid values
Expected behavior
At minimum, any value that is not a valid amount should be impossible to enter (negative, three decimals).
In addition to that, it would be good to keep the formatting consistent. So either .50
or 0.50
but not make both possible. Same for 3.5
vs 3.50
.
Actual behavior
See screenshots
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
valentinewallace commentedon Sep 19, 2018
@tanx If you have PayPal, for fiat input I'm making it behave exactly like the PayPal's input for making a payment. If you could try it out/sign off on that heuristic, that would be great since it's an opinionated UX :)
tanx commentedon Oct 1, 2018
@valentinewallace do you mean the iOS app for paypal? That looks good to me, but it only has a number pad as keyboard.
The problem is that we'd need to create a custom React Native
TextInput
since we're just using that standard component here. Perhaps there are some flags/options we can set to prevent negative numbers and multiple leading zeros. Although it doesn't seem too big a deal IMHO. lnd should throw an error for invalid amounts anyway if the user tries to submit.