Skip to content

Commit 41c0f29

Browse files
committed
bug fixes #538
1 parent cbfe240 commit 41c0f29

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

packages/ve-table/src/header/header-th.jsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -205,16 +205,20 @@ export default {
205205
if (leftColKey === rightColKey) {
206206
indicatorColKeys = [leftColKey];
207207
} else {
208-
indicatorColKeys = getColKeysByRangeColKeys({
209-
colKey1: leftColKey,
210-
colKey2: rightColKey,
211-
colgroups,
212-
});
208+
indicatorColKeys =
209+
getColKeysByRangeColKeys({
210+
colKey1: leftColKey,
211+
colKey2: rightColKey,
212+
colgroups,
213+
}) ?? [];
213214
}
214215

215216
let showIndicator = false;
216217
if (!isGroupHeader) {
217-
if (indicatorColKeys.indexOf(column["key"]) > -1) {
218+
if (
219+
column["key"] &&
220+
indicatorColKeys.indexOf(column["key"]) > -1
221+
) {
218222
showIndicator = true;
219223
}
220224
} else {

packages/ve-table/src/selection/index.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,10 @@ export default {
473473
cellEl = this.getTableLastRowCellByColKey(colKey);
474474
}
475475

476+
if (!cellEl) {
477+
return;
478+
}
479+
476480
const {
477481
left: cellLeft,
478482
top: cellTop,

packages/ve-table/src/util/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,7 @@ function getLeftmostOrRightmostColKey({ type, colgroups, colKeys }) {
10521052
const colIndex = colgroups.findIndex((x) => x.key === colKey);
10531053

10541054
if (colIndex === -1) {
1055-
console.error(
1055+
console.warn(
10561056
`getLeftmostOrRightmostColKey error:: can't find colKey:${colKey}`,
10571057
);
10581058
return false;

0 commit comments

Comments
 (0)