-
Notifications
You must be signed in to change notification settings - Fork 211
Closed
Description
🏷 Version
Package | Version |
---|---|
@antv/s2 | - 1.17.0 |
@antv/s2-react | - |
🖋 Description
S2 PivotSheet
When I set hideMeasureColumn
to true or false, the grand total cell has a different textAlign
behavior.
The column grand total cell uses the textAlign
style of DataCell
when set hideMeasureColumn
to false
, but hard code the style when hideMeasureColumn
is set to true
⌨️ Code Snapshots
/* col-cell.ts */
protected getTextStyle(): TextTheme {
const { isLeaf } = this.meta;
const textStyle = this.getOriginalTextStyle();
const hideMeasureColumn =
this.spreadsheet.options.style.colCfg.hideMeasureColumn;
let textAlign: TextAlign;
let textBaseline: TextBaseline;
if (isLeaf && !hideMeasureColumn) {
textAlign = this.theme.dataCell.text.textAlign;
textBaseline = this.theme.dataCell.text.textBaseline;
} else {
// 为方便 getTextAreaRange 计算文字位置
// textAlign 固定为 center
textAlign = 'center';
textBaseline = 'middle';
}
return { ...textStyle, textAlign, textBaseline };
}
🔗 Reproduce Link
https://codesandbox.io/s/great-andras-jj1jr7
🤔 Steps to Reproduce
- Create a PivotSheet
- Set options which made the column grand total cell display as a leaf node
- s2.render()
😊 Expected Behavior
The column grand total cell should renders with boldText
style of ColCell
😅 Current Behavior
Shown in the codesandbox link
💻 System information
chrome: 101.0, windows 10