Skip to content

Commit

Permalink
fix: fix frozen select display
Browse files Browse the repository at this point in the history
  • Loading branch information
Rui-Sun committed Jul 5, 2024
1 parent 449d9aa commit d3be757
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/vtable/src/scenegraph/select/update-select-border.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function updateComponent(

//#region 判断是不是按着表头部分的选中框 因为绘制层级的原因 线宽会被遮住一半,因此需要动态调整层级
let isNearRowHeader = table.frozenColCount ? startCol === table.frozenColCount : false;
if (!isNearRowHeader && table.frozenColCount && table.scrollLeft > 0) {
if (!isNearRowHeader && table.frozenColCount && table.scrollLeft > 0 && startCol >= table.frozenColCount) {
const startColRelativePosition = table.getColsWidth(0, startCol - 1) - table.scrollLeft;
if (startColRelativePosition < table.getFrozenColsWidth()) {
isNearRowHeader = true;
Expand All @@ -124,15 +124,15 @@ function updateComponent(
let isNearRightRowHeader = table.rightFrozenColCount
? table.rightFrozenColCount > 0 && endCol === table.colCount - table.rightFrozenColCount - 1
: false;
if (!isNearRightRowHeader && table.rightFrozenColCount) {
if (!isNearRightRowHeader && table.rightFrozenColCount && endCol < table.colCount - table.rightFrozenColCount) {
const endColRelativePosition = table.getColsWidth(0, endCol) - table.scrollLeft;
if (endColRelativePosition > table.tableNoFrameWidth - table.getRightFrozenColsWidth()) {
isNearRightRowHeader = true;
}
}

let isNearColHeader = table.frozenRowCount ? startRow === table.frozenRowCount : true;
if (!isNearColHeader && table.frozenRowCount && table.scrollTop > 0) {
if (!isNearColHeader && table.frozenRowCount && table.scrollTop > 0 && startRow >= table.frozenRowCount) {
const startRowRelativePosition = table.getRowsHeight(0, startRow - 1) - table.scrollTop;
if (startRowRelativePosition < table.getFrozenRowsHeight()) {
isNearColHeader = true;
Expand All @@ -142,7 +142,7 @@ function updateComponent(
let isNearBottomColHeader = table.bottomFrozenRowCount
? endRow === table.rowCount - table.bottomFrozenRowCount - 1
: false;
if (!isNearBottomColHeader && table.bottomFrozenRowCount) {
if (!isNearBottomColHeader && table.bottomFrozenRowCount && endRow < table.rowCount - table.bottomFrozenRowCount) {
const endRowRelativePosition = table.getRowsHeight(0, endRow) - table.scrollTop;
if (endRowRelativePosition > table.tableNoFrameHeight - table.getBottomFrozenRowsHeight()) {
isNearBottomColHeader = true;
Expand Down

0 comments on commit d3be757

Please sign in to comment.