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

在 Mac 系统上使用中文输入法时,onPressEnter 是否存在问题? #26

Open
Dreamer-Paul opened this issue Oct 24, 2022 · 0 comments

Comments

@Dreamer-Paul
Copy link

Dreamer-Paul commented Oct 24, 2022

公司项目使用了 Antd,而 Antd 依赖了 rc-input 的代码。通过查看源码后发现 onPressEnter 使用了 onkeydown 实现检查是否按下 Enter,但这种实现会导致在 Mac 系统上使用中文输入法的情况下,输入任意内容不选择任何联想项时按下 Enter 键,会触发对应逻辑,正常情况下应该不做处理?个人尝试后发现使用 onkeypress 是没有问题的。

这是我写的 最小复现 Demo,如果使用非 onkeypress 的方式捕获,则会触发此问题,Windows 貌似没有出现此问题。

rc-input 的最小复现

123123.mp4
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

No branches or pull requests

1 participant