Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修复组件层更新后 G 的 Group 图层累加的问题 #3081

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions packages/s2-core/src/facet/base-facet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -952,20 +952,9 @@ export abstract class BaseFacet {
};

public clearAllGroup() {
const { children = [] } = this.panelGroup;

for (let i = children.length - 1; i >= 0; i--) {
const child = children[i];

if (child instanceof Group) {
child.removeChildren();
} else {
children[i].remove();
}
}

this.foregroundGroup.removeChildren();
this.backgroundGroup.removeChildren();
this.panelGroup.remove();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change from removeChildren() to remove() will remove the entire group, not just its children. Ensure this is the intended behavior, as it may affect the rendering or structure if the group itself is needed later.

this.foregroundGroup.remove();
this.backgroundGroup.remove();
}

scrollWithAnimation = (
Expand Down
2 changes: 1 addition & 1 deletion packages/s2-core/src/facet/table-facet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export class TableFacet extends FrozenFacet {

public clearAllGroup() {
super.clearAllGroup();
this.emptyPlaceholderGroup.removeChildren();
this.emptyPlaceholderGroup.remove();
}

private initEmptyPlaceholderGroup() {
Expand Down
Loading