Skip to content

Commit

Permalink
fix(table): fix the table in the editable row status and press Enter …
Browse files Browse the repository at this point in the history
…to confirm #258
  • Loading branch information
anncwb committed Feb 8, 2021
1 parent 759e532 commit 64533f6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- 修复代码 debugger 位置显示错误
- 修复 mock 插件 post 请求错误问题
- 修复部分主题颜色值错误
- 修复表格在可编辑行状态回车确认

### 🎫 Chores

Expand Down
10 changes: 9 additions & 1 deletion src/components/Table/src/components/editable/EditableCell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
ref="elRef"
@change="handleChange"
@options-change="handleOptionsChange"
@pressEnter="handleSubmit"
@pressEnter="handleEnter"
/>
<div :class="`${prefixCls}__action`" v-if="!getRowEditable">
<CheckOutlined :class="[`${prefixCls}__icon`, 'mx-2']" @click="handleSubmit" />
Expand Down Expand Up @@ -234,6 +234,13 @@
isEdit.value = false;
}
async function handleEnter() {
if (props.column?.editRow) {
return;
}
handleSubmit();
}
function handleCancel() {
isEdit.value = false;
currentValueRef.value = defaultValueRef.value;
Expand Down Expand Up @@ -311,6 +318,7 @@
getWrapperStyle,
getRowEditable,
getValues,
handleEnter,
// getSize,
};
},
Expand Down

0 comments on commit 64533f6

Please sign in to comment.