Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix(sheet): fix the selection is incorrect when autofill intersects w… (#1661)

ybzkyebdcc6ccf663
diff --git a/packages/sheets-ui/src/services/selection/selection-shape-extension.ts b/packages/sheets-ui/src/services/selection/selection-shape-extension.ts
index 5ce40b1415..56e6a4c22d 100644
--- a/packages/sheets-ui/src/services/selection/selection-shape-extension.ts
+++ b/packages/sheets-ui/src/services/selection/selection-shape-extension.ts
@@ -980,7 +980,9 @@ export class SelectionShapeExtension {
}
} else if (rowOrColumn >= startRowOrColumn && rowOrColumn <= endRowOrColumn) {
isLighten = true;
- endRowOrColumn = rowOrColumn;
+ if (!this._isInMergeState) {
+ endRowOrColumn = rowOrColumn;
+ }
} else {
if (this._isInMergeState && rowOrColumn > endRowOrColumn) {
const current = rowOrColumn - endRowOrColumn;