ant-design / ant-design-web3

🥳 Efficient react components for building dapps easier | Connect crypto wallets and more Web3 UI components | Web3 icons | Supports Ethereum, Solana, Bitcoin, TON, Sui and others.
https://web3.ant.design
MIT License
891 stars 147 forks source link

feat: Optimize the input interaction of the CryptoInput component #1193

Closed kiner-tang closed 1 month ago

kiner-tang commented 1 month ago

[中文版模板 / Chinese template]

💡 Background and solution

before:

https://github.com/user-attachments/assets/c7699498-c94b-4545-80ae-0543183a5be8

https://github.com/user-attachments/assets/da4e3993-87cb-4703-a04d-f503b92a6ab6

After:

https://github.com/user-attachments/assets/5ae72802-08d1-4901-b2e7-725a2a518e06

🔗 Related issue link

changeset-bot[bot] commented 1 month ago

🦋 Changeset detected

Latest commit: 4b5c0d47e3109068982aa41ac6871076bd4b07ce

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages | Name | Type | | ------------------- | ----- | | @ant-design/web3 | Patch | | @example/eth-web3js | Patch | | @example/ethers-v5 | Patch | | @example/ethers | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ant-design-web3 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 4, 2024 3:22am
github-actions[bot] commented 1 month ago

Preview is ready

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.99%. Comparing base (cbbf0ce) to head (4b5c0d4). Report is 3 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1193 +/- ## ======================================= Coverage 99.99% 99.99% ======================================= Files 851 851 Lines 18147 18149 +2 Branches 1579 1582 +3 ======================================= + Hits 18146 18148 +2 Misses 1 1 ``` | [Flag](https://app.codecov.io/gh/ant-design/ant-design-web3/pull/1193/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ant-design) | Coverage Δ | | |---|---|---| | [](https://app.codecov.io/gh/ant-design/ant-design-web3/pull/1193/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ant-design) | `?` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ant-design#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

MarioJames commented 1 month ago

数量是特意做的不保留 因为在切换token后还保留数量的话 可能会超出对应的max

kiner-tang commented 1 month ago

数量是特意做的不保留 因为在切换token后还保留数量的话 可能会超出对应的max

切换 token 应该走重新计算呀,感觉如果用户先输入了很长一段数字,然后一切换 token 数字又没了要重新输入的话,用户体验不是很好

yutingzhao1991 commented 1 month ago

数量是特意做的不保留 因为在切换token后还保留数量的话 可能会超出对应的max

切换 token 应该走重新计算呀,感觉如果用户先输入了很长一段数字,然后一切换 token 数字又没了要重新输入的话,用户体验不是很好

+1

超过 max 的情况应该单独考虑,我看目前输入超过 max 也没做限制,可以考虑超过 max 自动设置到 max 或者给出错误提示。