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

fix: 通过正则匹配space,误判断删除键(backspace)是空格键(space) #3599

Merged
merged 1 commit into from
Nov 11, 2023

Conversation

liweijie0812
Copy link
Contributor

@liweijie0812 liweijie0812 commented Nov 11, 2023

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

#3598

空格space, 删除backspace ,正则判断space,触发删除键误判断是空格

💡 需求背景和解决方案

📝 更新日志

  • fix(Radio): useKeyboard 通过正则匹配space,误判断删除键(backspace)是空格键(space)

  • fix(Checkbox): useKeyboardEvent 通过正则匹配space,误判断删除键(backspace)是空格键(space)

  • 本条 PR 不需要纳入 Changelog

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

Copy link
Contributor

github-actions bot commented Nov 11, 2023

完成

@liweijie0812 liweijie0812 reopened this Nov 11, 2023
@liweijie0812 liweijie0812 changed the title fix: 判断空格/回车 fix: 通过正则匹配space,误判断删除键(backspace)是空格键(space) Nov 11, 2023
@uyarn uyarn merged commit 9a2b1b2 into Tencent:develop Nov 11, 2023
8 of 9 checks passed
@liweijie0812 liweijie0812 deleted the fix/checkout/useKeyboard branch November 11, 2023 13:41
This was referenced Nov 22, 2023
@@ -1,8 +1,8 @@
export const CHECKED_CODE_REG = /(enter|space)/i;
export const CHECKED_CODE = ['Enter', 'Space'];
Copy link
Collaborator

@chaishi chaishi Nov 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

辛苦调整 /(enter|space)/i/^(enter|space)$/i;
而非改为数组

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

分两步改
先把 CHECKED_CODE_REG 定义改到common Tencent/tdesign-common#1656
再来改框架的

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

Successfully merging this pull request may close these issues.

None yet

3 participants