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: 修复明细表空数据占位符背景穿透的问题 close #3077 #3079

Merged
merged 2 commits into from
Jan 17, 2025
Merged
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
5 changes: 5 additions & 0 deletions packages/s2-core/src/facet/table-facet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export class TableFacet extends FrozenFacet {
}

const { empty } = this.spreadsheet.options.placeholder!;
const { background } = this.spreadsheet.theme;

Choose a reason for hiding this comment

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

确保 background 对象存在,以避免在访问其 color 属性时出现潜在的运行时错误。可以考虑在使用前进行空值检查。

const { icon, description } = this.spreadsheet.theme.empty;
const {
horizontalBorderWidth,
Expand All @@ -148,6 +149,8 @@ export class TableFacet extends FrozenFacet {
stroke: horizontalBorderColor,
strokeWidth: horizontalBorderWidth,
strokeOpacity: horizontalBorderColorOpacity,
fill: background?.color,
lijinke666 marked this conversation as resolved.
Show resolved Hide resolved
fillOpacity: background?.opacity ?? 1,
},
});

Expand All @@ -173,6 +176,8 @@ export class TableFacet extends FrozenFacet {
y: descY,
},
});

this.emptyPlaceholderGroup.toFront();
}

private getDataCellAdaptiveHeight(viewMeta: ViewMeta): number {
Expand Down
Loading