When scrolling the spreadsheet, the return of getMeta function is confusing after extending class MergedCell . It returns data or null .
⌨️ Code Snapshots
export const getTempMergedCell = (
allVisibleCells: DataCell[],
sheet?: SpreadSheet,
cellsInfos: MergedCellInfo[] = [],
): TempMergedCell => {
const { cellsMeta, cells, invisibleCellInfo } = getVisibleInfo(
cellsInfos,
allVisibleCells,
);
let viewMeta: ViewMeta | Node | undefined = cellsMeta;
let mergedAllCells: DataCell[] = cells;
// some cells are invisible and some cells are visible
const isPartiallyVisible =
invisibleCellInfo?.length > 0 &&
invisibleCellInfo.length < cellsInfos.length;
// 当 MergedCell 只有部分在可视区域时,在此获取 MergedCell 不在可视区域内的 cells
if (isPartiallyVisible) {
const { cells: invisibleCells, cellsMeta: invisibleMeta } =
getInvisibleInfo(invisibleCellInfo, sheet!);
viewMeta = viewMeta || invisibleMeta;
mergedAllCells = cells.concat(invisibleCells); // this is the boob which will explode anytime
}
if (!isEmpty(cells) && !viewMeta) {
// 如果没有指定合并后的文本绘制的位置,默认画在选择的第一个单元格内
viewMeta = mergedAllCells[0]?.getMeta() as ViewMeta;
}
return {
cells: mergedAllCells,
viewMeta: viewMeta as ViewMeta,
};
};
When scolling the spreadsheet, invisibleCells may be any position includes top, bottom, left , right . But here , Simplely add it to the tail. So the viewMeta will be data or null .
mergedAllCells should be sorted by colIndex and rowIndex .
🏷 Version
Sheet Type
🖋 Description
When scrolling the spreadsheet, the return of getMeta function is confusing after extending class MergedCell . It returns data or null .
⌨️ Code Snapshots
When scolling the spreadsheet, invisibleCells may be any position includes top, bottom, left , right . But here , Simplely add it to the tail. So the viewMeta will be data or null .
mergedAllCells should be sorted by colIndex and rowIndex .
🔗 Reproduce Link
🤔 Steps to Reproduce
😊 Expected Behavior
viewMeta should be data anytimes
😅 Current Behavior
💻 System information