feat: add thousands separator support to Input component#10725
Draft
Kahnchan wants to merge 7 commits intoOneKeyHQ:xfrom
Draft
feat: add thousands separator support to Input component#10725Kahnchan wants to merge 7 commits intoOneKeyHQ:xfrom
Kahnchan wants to merge 7 commits intoOneKeyHQ:xfrom
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Contributor
|
法语、德语区的用户有问题,看 devin 的评论 |
- Use locale-specific grouping and decimal separators from LOCALE_SEPARATORS instead of hardcoded commas, so German/French/etc. users see correct format - Apply locale decimal display (e.g. ',' for de/fr) to all decimal-pad inputs, not only those with enableThousandsSeparator - Fix European locale decimal entry: use separator count comparison to distinguish thousands-separator chars from user-typed decimal separators (e.g. German user pressing '.' on an English keyboard)
Contributor
Author
我重新提了 PR,主要是两个功能改动:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Input组件新增enableThousandsSeparatorprop,启用后在输入过程中自动插入千分位符号,已应用于 Perp 交易面板的价格/数量输入及存取款金额输入keyboardType="decimal-pad"/"number-pad"的 input 自动将内部存储的.转换为当前 locale 的小数符号显示(如德语显示,),内部 raw value 不变.)、法语(groupSep=\u202F)等 locale 下小数符号被误判为千分位而丢失$前缀替换为USDC后缀Locale 支持一览
,.1.234.567,89,1 234 567,89,1 234 567,89.,1,234,567.89Test plan
,,小数点为..,小数点显示为,;按.或,均可输入小数,enableThousandsSeparator的旧 input 行为不变USDC而非$