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

Ensure CID always shows as a number #128

Merged
merged 1 commit into from
Jul 6, 2024

Conversation

neilenns
Copy link
Contributor

@neilenns neilenns commented Jul 6, 2024

Fixes #127

  • Change the input field type to text instead of number
  • Make the input field controlled
  • Strip any non-digit characters from the input

I have no idea if this is actually the fix for the problem since I can't reproduce it. However, this was the only place in the code that attempted to treat the value as a number, so it's possible the browser happened to try and display it in scientific notation for some reason.

Tested on Windows that I can still type digits in, use the backspace key, and paste in a CID without issue. Any non-digit characters simply don't appear.

@pierr3 pierr3 merged commit 4560e23 into pierr3:main Jul 6, 2024
3 checks passed
@neilenns neilenns deleted the neilenns/issue127 branch July 6, 2024 20:21
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.

CID incorrectly shows in scientific notation
2 participants