Skip to content

Commit

Permalink
fix: fix child judegment in get first/last child
Browse files Browse the repository at this point in the history
  • Loading branch information
Rui-Sun committed Dec 25, 2024
1 parent b198473 commit a67ec98
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ describe('listTable-checkbox init test', () => {

const listTable = new ListTable(containerDom, option);
test('listTable-checkbox getCheckboxState', () => {
expect(listTable.stateManager?.checkedState.size).toEqual(101);
expect(listTable.stateManager?.checkedState.size).toEqual(100);
expect(listTable.getCheckboxState().length).toEqual(2000);
listTable.release();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,15 @@ function checkHasColMerge(colStart: number, colEnd: number, row: number, proxy:

export function getFirstChild(containerGroup: Group): Group {
let child = containerGroup.firstChild as Group;
while (child.type !== 'group') {
while (child && child.type !== 'group') {
child = child._next as Group;
}
return child;
}

export function getLastChild(containerGroup: Group): Group {
let child = containerGroup.lastChild as Group;
while (child.type !== 'group') {
while (child && child.type !== 'group') {
child = child._prev as Group;
}
return child;
Expand Down

0 comments on commit a67ec98

Please sign in to comment.