react-component / react-component/input-number

win10,chrome浏览器,微软拼音中文输入法,formatter导致onChange会触发两次

Open
#283 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
323
Forks
188
Avg merge
20h 3m
Merged PRs (30d)
1

Description

问题表现同 #276

问题描述: 比如存在formatter函数时(见下面地址), 当输入1234时,期待显示$1,234, 但是实际显示$12,344

复现地址:http://react-component.github.io/input-number/examples?path=/story/rc-input-number--formatter

复现的环境: windows10, chrome浏览器版本号:87.0.4280.88, 微软拼音输入法切换到中文输入状态。

进一步研究源码发现,当存在formatter属性并且formatter返回一个新的值时,会触发onChange函数两次。

firefox表现正常,只会触发onChange一次。
中文其他输入法(如qq拼音输入法)没有问题,微软拼音输入法英文状态也没有问题。
mac下表现正常。

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the formatter example at the linked rc-input-number Storybook URL and reproduce it on Windows 10 with Chrome and Microsoft Pinyin in Chinese mode. Trace the formatter and onChange handling to determine why entering 1234 produces $12,344 and fires onChange twice; done means the display is $1,234 and onChange fires once, while Firefox and unaffected input methods remain working.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.