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: fixed the issue where the SheetEditEnded event listener returned incorrect row and column (#5442)

wpxp123456e4fbd4ca0d68
diff --git a/packages/sheets-ui/src/controllers/editor/editing.render-controller.ts b/packages/sheets-ui/src/controllers/editor/editing.render-controller.ts
index a3fa969c2d..fd5f99886b 100644
--- a/packages/sheets-ui/src/controllers/editor/editing.render-controller.ts
+++ b/packages/sheets-ui/src/controllers/editor/editing.render-controller.ts
@@ -534,17 +534,6 @@ export class EditingRenderController extends Disposable {
});
}
- // If neither the formula bar editor nor the cell editor has been edited,
- // it is considered that the content has not changed and returns directly.
- const editorIsDirty = this._editorBridgeService.getEditorDirty();
- if (editorIsDirty === false) {
- if (this._editorBridgeService.isForceKeepVisible()) {
- this._editorBridgeService.disableForceKeepVisible();
- }
- this._moveSelection(keycode, currentUnitId, worksheetId);
- return;
- }
-
// Reselect the current selections, when exist cell editor by press ESC.I
if (keycode === KeyCode.ESC) {
if (this._editorBridgeService.isForceKeepVisible()) {
diff --git a/packages/sheets-ui/src/views/editor-container/hooks.ts b/packages/sheets-ui/src/views/editor-container/hooks.ts
index d0c372a8fb..6b332b33cb 100644
--- a/packages/sheets-ui/src/views/editor-container/hooks.ts
+++ b/packages/sheets-ui/src/views/editor-container/hooks.ts
@@ -35,7 +35,7 @@ export function useKeyEventConfig(isRefSelecting: React.MutableRefObject<0 | 1 |
handler: (keycode: KeyCode) => {
if (keycode === KeyCode.ENTER || keycode === KeyCode.ESC || keycode === KeyCode.TAB) {
editorBridgeService.disableForceKeepVisible();
- commandService.executeCommand(SetCellEditVisibleOperation.id, {
+ commandService.syncExecuteCommand(SetCellEditVisibleOperation.id, {
visible: false,
eventType: DeviceInputEventType.Keyboard,
keycode,