Skip to content

Commit 9c23565

Browse files
committed
修复长时间键盘操作 arrowUp 导致选中框消失的的问题
1 parent 6dec492 commit 9c23565

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/ve-table/src/index.jsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -593,17 +593,13 @@ export default {
593593
event.preventDefault();
594594
if (rowIndex > 0) {
595595
const nextRowKey = allRowKeys[rowIndex - 1];
596-
this.cellSelectionKeyData.rowKey = nextRowKey;
597-
598596
this.rowToVisible(KEY_CODES.ARROW_UP, nextRowKey);
599597
}
600598
} else if (keyCode === KEY_CODES.ARROW_DOWN) {
601599
event.preventDefault();
602600

603601
if (rowIndex < allRowKeys.length - 1) {
604602
const nextRowKey = allRowKeys[rowIndex + 1];
605-
this.cellSelectionKeyData.rowKey = nextRowKey;
606-
607603
this.rowToVisible(KEY_CODES.ARROW_DOWN, nextRowKey);
608604
}
609605
}
@@ -742,6 +738,8 @@ export default {
742738
tableContainerRef.scrollTop = containerScrollTop + diff;
743739
}
744740
}
741+
// 解决滚动过快导致选中框消失的问题
742+
this.cellSelectionKeyData.rowKey = nextRowKey;
745743
}
746744
},
747745

0 commit comments

Comments
 (0)