fix: borders in selection and edit cell
This commit is contained in:
@@ -539,7 +539,8 @@ const EditorWrapper = styled("div")`
|
|||||||
vertical-align: bottom;
|
vertical-align: bottom;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
outline: 3px solid ${outlineColor}40;
|
outline: 3px solid #FBE0C9;
|
||||||
|
z-index: 1000;
|
||||||
span {
|
span {
|
||||||
min-width: 1px;
|
min-width: 1px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1633,10 +1633,13 @@ export default class WorksheetCanvas {
|
|||||||
);
|
);
|
||||||
handleX = areaX + areaWidth;
|
handleX = areaX + areaWidth;
|
||||||
handleY = areaY + areaHeight;
|
handleY = areaY + areaHeight;
|
||||||
|
const isSelecting = this.workbookState.isSelecting();
|
||||||
|
// Add 1px when selecting to compensate for missing border
|
||||||
|
const borderCompensation = isSelecting ? 1 : 0;
|
||||||
areaOutline.style.left = `${areaX - padding - 1}px`;
|
areaOutline.style.left = `${areaX - padding - 1}px`;
|
||||||
areaOutline.style.top = `${areaY - padding - 1}px`;
|
areaOutline.style.top = `${areaY - padding - 1}px`;
|
||||||
areaOutline.style.width = `${areaWidth + 2 * padding + 1}px`;
|
areaOutline.style.width = `${areaWidth + 2 * padding + 1 + borderCompensation}px`;
|
||||||
areaOutline.style.height = `${areaHeight + 2 * padding + 1}px`;
|
areaOutline.style.height = `${areaHeight + 2 * padding + 1 + borderCompensation}px`;
|
||||||
const clipLeft = rowStart < topLeftCell.row && rowStart > frozenRows;
|
const clipLeft = rowStart < topLeftCell.row && rowStart > frozenRows;
|
||||||
const clipTop =
|
const clipTop =
|
||||||
columnStart < topLeftCell.column && columnStart > frozenColumns;
|
columnStart < topLeftCell.column && columnStart > frozenColumns;
|
||||||
@@ -1648,7 +1651,7 @@ export default class WorksheetCanvas {
|
|||||||
clipLeft,
|
clipLeft,
|
||||||
clipTop,
|
clipTop,
|
||||||
);
|
);
|
||||||
areaOutline.style.border = this.workbookState.isSelecting()
|
areaOutline.style.border = isSelecting
|
||||||
? "none"
|
? "none"
|
||||||
: `1px solid ${outlineColor}`;
|
: `1px solid ${outlineColor}`;
|
||||||
// hide the handle if it is out of the visible area
|
// hide the handle if it is out of the visible area
|
||||||
|
|||||||
Reference in New Issue
Block a user