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/numericinput edge cases #561

Merged
merged 10 commits into from
Sep 30, 2024
Merged

Fix/numericinput edge cases #561

merged 10 commits into from
Sep 30, 2024

Conversation

Sharqiewicz
Copy link
Collaborator

@Sharqiewicz Sharqiewicz commented Sep 23, 2024

  • if the user input is "0.23" and the cursor is between "2" and "3" and the user enters "."
    expected: ignore the input as there is already one "." in the input field further to the left
    actual: input changes to "0.2"
  • if the user input is "12.34" and the cursor is between "1" and "2" and the user enters "."
    expected: either ignore the input as there is already a "." in the input field further to the right or replace input to "1.234"
    actual" input changes to "1.2"

Copy link

netlify bot commented Sep 23, 2024

Deploy Preview for rococo-souffle-a625f5 ready!

Name Link
🔨 Latest commit 1d01950
🔍 Latest deploy log https://app.netlify.com/sites/rococo-souffle-a625f5/deploys/66faaabe251e21000834b3c0
😎 Deploy Preview https://deploy-preview-561--rococo-souffle-a625f5.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@TorstenStueber TorstenStueber left a comment

Choose a reason for hiding this comment

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

This feels very nice, great job.

However, there are cases where the paste event does not behave as expected, namely if I want to paste text within the current text, it will be pasted to the end.

Example:

  • input field value is "123"
  • my clipboard has the content "4"
  • cursor is at the beginning of the input field
  • I paste

Expected outcome: 4123 (and cursor between the 4 and 1)
Actual outcome: 1234 (and cursor at the end)

This works correctly on Uniswap.

@Sharqiewicz
Copy link
Collaborator Author

@TorstenStueber

Copy link
Member

@ebma ebma left a comment

Choose a reason for hiding this comment

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

Nice 👍

Copy link
Member

@TorstenStueber TorstenStueber left a comment

Choose a reason for hiding this comment

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

Perfection 😍.

src/components/Form/From/NumericInput/helpers.ts Outdated Show resolved Hide resolved
@Sharqiewicz Sharqiewicz merged commit 6b533e7 into main Sep 30, 2024
5 checks passed
@Sharqiewicz Sharqiewicz deleted the fix/numericinput-edge-cases branch September 30, 2024 14:36
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.

3 participants