mirror of
https://github.com/dream-num/univer.git
synced 2026-09-24 15:32:18 +08:00
fix(editor): fix the issue where content being edited in a cell would be reset (#6495)
This commit is contained in:
+13
-14
@@ -17,14 +17,13 @@
|
||||
import type { ICommandInfo, IDisposable, IExecutionOptions, ISelectionCell, Nullable, Workbook } from '@univerjs/core';
|
||||
import type { IEditorInputConfig } from '@univerjs/docs-ui';
|
||||
import type { IRender, IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
||||
import type { ISelectionWithStyle, ISetRangeValuesMutationParams } from '@univerjs/sheets';
|
||||
import type { ISelectionWithStyle } from '@univerjs/sheets';
|
||||
import type { ICurrentEditCellParam, IEditorBridgeServiceVisibleParam } from '../../services/editor-bridge.service';
|
||||
import { DisposableCollection, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, FOCUSING_FX_BAR_EDITOR, FOCUSING_SHEET, ICommandService, IContextService, Inject, IUniverInstanceService, RxDisposable, toDisposable, UniverInstanceType } from '@univerjs/core';
|
||||
import { DocSelectionRenderService } from '@univerjs/docs-ui';
|
||||
import { DeviceInputEventType, IRenderManagerService } from '@univerjs/engine-render';
|
||||
import {
|
||||
ClearSelectionFormatCommand,
|
||||
SetRangeValuesMutation,
|
||||
SetWorksheetActiveOperation,
|
||||
SheetsSelectionsService,
|
||||
} from '@univerjs/sheets';
|
||||
@@ -206,18 +205,18 @@ export class EditorBridgeRenderController extends RxDisposable implements IRende
|
||||
this._editorBridgeService.refreshEditCellState();
|
||||
}
|
||||
|
||||
if (command.id === SetRangeValuesMutation.id) {
|
||||
const params = command.params as ISetRangeValuesMutationParams;
|
||||
const { cellValue, unitId, subUnitId } = params;
|
||||
if (!cellValue) return;
|
||||
const editCell = this._editorBridgeService.getEditLocation();
|
||||
if (editCell) {
|
||||
const { unitId: editingUnitId, sheetId: editingSheetId, row, column } = editCell;
|
||||
if (unitId === editingUnitId && subUnitId === editingSheetId && cellValue && cellValue[row] && Object.prototype.hasOwnProperty.call(cellValue[row], column)) {
|
||||
this._editorBridgeService.refreshEditCellState();
|
||||
}
|
||||
}
|
||||
}
|
||||
// if (command.id === SetRangeValuesMutation.id) {
|
||||
// const params = command.params as ISetRangeValuesMutationParams;
|
||||
// const { cellValue, unitId, subUnitId } = params;
|
||||
// if (!cellValue) return;
|
||||
// const editCell = this._editorBridgeService.getEditLocation();
|
||||
// if (editCell) {
|
||||
// const { unitId: editingUnitId, sheetId: editingSheetId, row, column } = editCell;
|
||||
// if (unitId === editingUnitId && subUnitId === editingSheetId && cellValue && cellValue[row] && Object.prototype.hasOwnProperty.call(cellValue[row], column)) {
|
||||
// this._editorBridgeService.refreshEditCellState();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}));
|
||||
|
||||
d.add(this._commandService.beforeCommandExecuted((command: ICommandInfo, options?: IExecutionOptions) => {
|
||||
|
||||
Reference in New Issue
Block a user