NumberField switches to Arabic numbering after entering only a period in percentage fields
维护者通常 1 天内回复
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 65/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- react, typescript
调研方向
Start with the NumberParser implementation in @internationalized/number and trace how getNumberingSystem('.') selects a system; the report says partial-input validation should remain permissive. Read the React Aria Components regression test described in the issue and add coverage for the unit-percent display after blur. Done means period-only input retains the configured locale’s numbering system while non-Latin numeral detection and decimal-separator detection still work.
由索引模型根据 Issue 内容生成。
描述
General summary
Entering only . in a percentage NumberField and then blurring can switch the displayed digits and percent sign to Arabic, even though the locale has not changed. This reproduces in the public React Spectrum v3 documentation as well as an integer percentage field using Spectrum 2.
Related: #3862 (closed), which describes a similar comma-only numbering-system switch. No open duplicate was found for this remaining period-only case.
Expected Behavior
The formatted result should retain the numbering system configured by the locale/options. A grouping separator alone should not cause an English-locale field to switch to Arabic numbering.
Current Behavior
The field displays Arabic digits and an Arabic percent sign after blur.
In the unit-percent reproduction below, 1% becomes ١٪ (\u0661\u066a\u061c), while the numeric value remains 1 and no numeric onChange event fires. Repeating with , restores 1% normally.
The documentation example uses style: 'percent' rather than style: 'unit'. Its numeric parsing behavior is separate from the unexpected numbering-system switch; this report focuses on the display changing to Arabic.
Steps to Reproduce
Public documentation example - no local setup required
- Open https://react-spectrum.adobe.com/v3/NumberField.html#percentages with an English/Latin-numbering locale.
- In the Sales tax example, select the entire displayed value and replace it with a single
.. - Click outside the field.
- Observe that the resulting percentage is displayed using Arabic numbering rather than the original Latin numbering.
The example is:
<NumberField
label="Sales tax"
formatOptions={{style: 'percent'}}
minValue={0}
defaultValue={0.05}
/>
Integer percentage reproduction
With an en-US Spectrum 2 NumberField:
<NumberField
label="Percentage"
defaultValue={1}
minValue={1}
maxValue={99}
step={1}
formatOptions={{
style: 'unit',
unit: 'percent',
maximumFractionDigits: 0
}}
/>
Replace the value with . and blur: 1% becomes ١٪ instead of restoring 1%.
Underlying parser reproduction
import {NumberParser} from '@internationalized/number';
let parser = new NumberParser('en-US', {
style: 'unit',
unit: 'percent',
maximumFractionDigits: 0
});
parser.isValidPartialNumber('.'); // true
parser.parse('.'); // NaN
parser.getNumberingSystem('.'); // 'arab'; expected 'latn'
parser.getNumberingSystem(','); // 'latn'
Possible Solution
NumberParser accepts . as partial Arabic input because it normalizes to an Arabic grouping separator. getNumberingSystem reports that candidate system even when the input contains no numerals or decimal separator, and NumberField uses it when formatting on blur.
Keep partial-input validation permissive, but require numeral or meaningful decimal-separator evidence before choosing an alternative numbering system. Otherwise return the default system for the configured locale/options. Preserve actual non-Latin numeral detection and existing decimal-separator detection when decimals are allowed.
A React Aria Components regression test reproduces the unit-percent display issue on unmodified main; a fix and regression tests are being prepared.
Context
Percentage inputs unexpectedly switch writing systems after an incomplete edit. The public documentation reproduction shows this is not specific to application code or custom change handlers.
Version
Observed with @react-spectrum/s2 1.8.2 and @internationalized/number 3.6.9. The unit-percent case also reproduces in repository tests on main at 3280ed4b0e65cfce16ae2767aba52a5f9a8ad4d6.
The public v3 documentation example was reproduced on October 27, 2026; its deployed package version was not determined.
Browsers
Google Chrome 156.0.8078.48. The unit-percent case was independently reproduced in the repository Jest/JSDOM environment.
Operating System
macOS. Automated reproduction uses Node.js 24.21.0.
Company/Team
Adobe Marketo CET.
Tracking Issue
Related closed report: #3862.
Prepared with GitHub Copilot assistance.
- 主要语言
- TypeScript
- 星标
- 16k
- 派生
- 1.6k
- 平均合并
- 4 天 3 小时
- 30 天内合并 PR
- 39
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
adobe/react-spectrum 的其他 Issue
-
@internationalized/number: NumberParser misparses Arabic-digit numbers that use . , or ، (sd parses ١٬٢٣٤.٥ as 12345)可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
adobe/react-spectrum#10936 · 2 条评论 ·
维护者通常 1 天内回复
-
PreviewTrigger: the preview dialog has no accessible name可能已有人在做 @therealemmanueloppong 于 3 天前认领。 未关闭accessibility bug PreviewTrigger
难度 2/5 1-3 小时 新手友好度 76/100
adobe/react-spectrum#10917 · 3 条评论 ·
维护者通常 1 天内回复
-
S2 quiet Picker menu is always 192px wide: its width calc() has no unit可能已有人在做 @darshpatel1052 于 5 天前认领。 未关闭waiting on author
难度 2/5 1 小时以内 新手友好度 88/100
adobe/react-spectrum#10909 · 3 条评论 ·
维护者通常 1 天内回复
-
DatePicker omits timezone for initially empty fields despite zoned placeholderValue可能已有人在做 @mrlexcoder 于 5 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 68/100
adobe/react-spectrum#10900 · 2 条评论 ·
维护者通常 1 天内回复
-
Separator adds a redundant role="separator" to its default <hr>可能已有人在做 @Janani-bn 于 6 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
adobe/react-spectrum#10894 · 2 条评论 ·
维护者通常 1 天内回复
查看 adobe/react-spectrum 的全部 Issue
相似的 Issue
-
难度 1/5 1-3 小时 新手友好度 88/100
danielw-sudo/agentuto#63 ·
维护者通常 1 天内回复
-
idea-scout idea:341
难度 2/5 1-3 小时 新手友好度 76/100
jeanibarz/agent-notebook#341 ·
维护者通常 1 天内回复
-
documentation good first issue roadmap
难度 1/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
type:bug
难度 2/5 1-3 小时 新手友好度 72/100
nightgauge/nightgauge#3077 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
LibreChat-AI/LibreChat#17915 ·
维护者通常 1 天内回复