Skip to content

Commit 1cab959

Browse files
committed
Update index.jsx
1 parent e235607 commit 1cab959

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

packages/ve-table/src/index.jsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1594,7 +1594,11 @@ export default {
15941594
this[INSTANCE_METHODS.SET_CELL_SELECTION]({
15951595
rowKey,
15961596
colKey: column.key,
1597+
isScrollToRow: false,
15971598
});
1599+
// row to visible
1600+
this.rowToVisible(KEY_CODES.ARROW_UP, rowKey);
1601+
this.rowToVisible(KEY_CODES.ARROW_DOWN, rowKey);
15981602
},
15991603

16001604
/*
@@ -1794,7 +1798,11 @@ export default {
17941798
/*
17951799
set cell selection and column to visible
17961800
*/
1797-
[INSTANCE_METHODS.SET_CELL_SELECTION]({ rowKey, colKey }) {
1801+
[INSTANCE_METHODS.SET_CELL_SELECTION]({
1802+
rowKey,
1803+
colKey,
1804+
isScrollToRow = true,
1805+
}) {
17981806
const { cellSelectionOption } = this;
17991807

18001808
if (
@@ -1815,7 +1823,9 @@ export default {
18151823
// column to visible
18161824
this.columnToVisible(column);
18171825
// row to visible
1818-
this[INSTANCE_METHODS.SCROLL_TO_ROW_KEY]({ rowKey });
1826+
if (isScrollToRow) {
1827+
this[INSTANCE_METHODS.SCROLL_TO_ROW_KEY]({ rowKey });
1828+
}
18191829
}
18201830
},
18211831

0 commit comments

Comments
 (0)