Commit 64533f6204f96f79c6006d9911e9417cd9800d0d
1 parent
759e5320
fix(table): fix the table in the editable row status and press Enter to confirm #258
Showing
2 changed files
with
10 additions
and
1 deletions
CHANGELOG.zh_CN.md
src/components/Table/src/components/editable/EditableCell.vue
... | ... | @@ -17,7 +17,7 @@ |
17 | 17 | ref="elRef" |
18 | 18 | @change="handleChange" |
19 | 19 | @options-change="handleOptionsChange" |
20 | - @pressEnter="handleSubmit" | |
20 | + @pressEnter="handleEnter" | |
21 | 21 | /> |
22 | 22 | <div :class="`${prefixCls}__action`" v-if="!getRowEditable"> |
23 | 23 | <CheckOutlined :class="[`${prefixCls}__icon`, 'mx-2']" @click="handleSubmit" /> |
... | ... | @@ -234,6 +234,13 @@ |
234 | 234 | isEdit.value = false; |
235 | 235 | } |
236 | 236 | |
237 | + async function handleEnter() { | |
238 | + if (props.column?.editRow) { | |
239 | + return; | |
240 | + } | |
241 | + handleSubmit(); | |
242 | + } | |
243 | + | |
237 | 244 | function handleCancel() { |
238 | 245 | isEdit.value = false; |
239 | 246 | currentValueRef.value = defaultValueRef.value; |
... | ... | @@ -311,6 +318,7 @@ |
311 | 318 | getWrapperStyle, |
312 | 319 | getRowEditable, |
313 | 320 | getValues, |
321 | + handleEnter, | |
314 | 322 | // getSize, |
315 | 323 | }; |
316 | 324 | }, | ... | ... |