Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

AmountInputField behaviour not constrained #615

Open
joostjager opened this issue Sep 4, 2018 · 2 comments
Open

AmountInputField behaviour not constrained #615

joostjager opened this issue Sep 4, 2018 · 2 comments
Assignees

Comments

@joostjager
Copy link

Description

Various undesired states can be created in the amount input field.

image

  • Negative amount

  • Multiple leading zeros

  • More than two decimals

  • Label gets too large

  • Entering 0-

image

  • Multiple dots ...4

image

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

@valentinewallace
Copy link
Contributor

@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
Copy link
Contributor

tanx commented 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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants