Skip to content
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

fix: Amount input correctly handles numbers and dots #481

Merged
merged 6 commits into from Mar 17, 2021

Conversation

obany
Copy link
Contributor

@obany obany commented Mar 16, 2021

Description of change

The amount input now handles input correctly.
Input control now has integer and float support, not just numeric.
Scientific notation is handled correctly.
Additional focus visuals added.
Autofocus on send page.
Defaults to empty.

Links to any relevant issues

Fixes #473

Type of change

Choose a type of change, and delete any options that are not relevant.

  • Bug fix (a non-breaking change which fixes an issue)

How the change has been tested

Tested on windows.

Change checklist

Add an x to the boxes that are relevant to your changes, and delete any items that are not.

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

return "0";
}
if (!UNIT_MAP[fromUnit]) {
throw new Error(`Unrecognized fromUnit ${fromUnit}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not need to catch these?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean they are never going to fire, but still, seems odd to leave them uncaught.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just pulled this method from my iota.js lib which already did the necessary conversion.

@cvarley100 cvarley100 merged commit 6060a8d into develop Mar 17, 2021
@cvarley100 cvarley100 deleted the fix/amount-input branch March 17, 2021 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Amount" fields are accepting the letter E as valid input
3 participants