Skip to content

Commit

Permalink
Fix: Radio enter event will cancel select (#2054)
Browse files Browse the repository at this point in the history
* fix radio enter will cancel value

* changelog
  • Loading branch information
leehaoChen authored Oct 17, 2023
1 parent c19b493 commit 2427efb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "shineout",
"version": "2.0.9",
"version": "2.0.10-beta.1",
"description": "Shein 前端组件库",
"main": "./lib/index.js",
"module": "./es/index.js",
Expand Down
3 changes: 3 additions & 0 deletions site/pages/documentation/changelog/2.x.x.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# 更新日志
`### 2.0.10
- 修复 Radio 回车会取消选择的问题(< 2.0.10)

### 2.0.9
- 修复 FieldSet Children 类型错误(< 2.0.9)

Expand Down
1 change: 1 addition & 0 deletions src/Checkbox/CheckItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ function checkItem(type: CheckType): React.ComponentClass<CheckItemProps, Checkb

handleEnter(e: KeyboardEvent) {
if (isEnterPress(e)) {
if (type === 'radio' && this.getChecked()) return
this.handleChange({
target: {
checked: !this.getChecked(),
Expand Down

0 comments on commit 2427efb

Please sign in to comment.