20260802220544
This commit is contained in:
1 parent
c00329b5a4
commit
4fc9040a8a
60 files changed
+6273
-908
No files matched your search
@@ -135,9 +135,11 @@ function editorValuesEqual(col, previous, current) {
|
||||
return String(previous ?? "") === String(current ?? "");
|
||||
}
|
||||
|
||||
const selectOnFocus = ref(true);
|
||||
const editingCtx = {
|
||||
isEditing: (row) => props.editable && getRowEditingState(row)?.value.editing,
|
||||
shouldFocus: (row, col) => getRowEditingState(row)?.value.focusCol === col.dataIndex,
|
||||
shouldSelectOnFocus: selectOnFocus,
|
||||
shouldNotify: (row, col, newValue) => {
|
||||
const values = getRowEditingState(row)?.value.initialValues;
|
||||
if (!values?.has(col.dataIndex)) return true;
|
||||
@@ -329,6 +331,7 @@ function commitPendingEditing() {
|
||||
);
|
||||
if (row) {
|
||||
activateEditing(row, target.focusCol);
|
||||
tableRef.value?.setCurrentRow?.(row, { silent: true });
|
||||
lastEditActivateAt = performance.now();
|
||||
}
|
||||
}
|
||||
@@ -405,6 +408,7 @@ function handleAreaSelectionChange(ranges) {
|
||||
pendingEditingTarget = null;
|
||||
clearEditActivateTimer();
|
||||
activateEditing(row, focusCol);
|
||||
tableRef.value?.setCurrentRow?.(row, { silent: true });
|
||||
lastEditActivateAt = now;
|
||||
} else {
|
||||
pendingEditingTarget = { row, focusCol };
|
||||
@@ -414,10 +418,18 @@ function handleAreaSelectionChange(ranges) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 非键盘导航(鼠标点击等):立即激活
|
||||
// 非键盘导航(鼠标点击等):立即激活。
|
||||
// 同一行已编辑时仍更新 focusCol(保证焦点切换到新列),
|
||||
// 但暂时禁用 select 全选(避免鼠标点击触发全选文本)。
|
||||
pendingEditingTarget = null;
|
||||
clearEditActivateTimer();
|
||||
activateEditing(row, focusCol);
|
||||
if (activeEditingRow === row) {
|
||||
selectOnFocus.value = false;
|
||||
activateEditing(row, focusCol);
|
||||
nextTick(() => { selectOnFocus.value = true; });
|
||||
} else {
|
||||
activateEditing(row, focusCol);
|
||||
}
|
||||
lastEditActivateAt = performance.now();
|
||||
}
|
||||
|
||||
@@ -599,6 +611,7 @@ defineExpose({
|
||||
.fms-cell-display {
|
||||
display: block;
|
||||
min-width: 0;
|
||||
user-select: text;
|
||||
}
|
||||
|
||||
.fms-table__inner.text-overflow .fms-cell-display {
|
||||
|
||||
Reference in new issue
Block a user