Skip to content

Commit

Permalink
fix(editor): focusing error (#2264)
Browse files Browse the repository at this point in the history
  • Loading branch information
DR-Univer committed May 17, 2024
1 parent 1d11418 commit 0831994
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/docs-ui/src/controllers/text-selection.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export class TextSelectionController extends Disposable {
}
}

// eslint-disable-next-line max-lines-per-function
private _initialMain(unitId: string) {
const docObject = this._getDocObjectById(unitId);
if (docObject == null) {
Expand Down Expand Up @@ -133,6 +134,7 @@ export class TextSelectionController extends Disposable {
* The order of occurrence is such that PointerDown comes first.
* Translate the above text into English.
*/
this._setEditorFocus(unitId);
setTimeout(() => {
this._setEditorFocus(unitId);
this._textSelectionRenderManager.setCursorManually(offsetX, offsetY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ import {
Disposable,
EDITOR_ACTIVATED,
FOCUSING_EDITOR_BUT_HIDDEN,
FOCUSING_EDITOR_STANDALONE,
FOCUSING_FORMULA_EDITOR,
FOCUSING_SHEET,
FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE,
HorizontalAlign,
ICommandService,
IContextService,
Expand Down Expand Up @@ -165,7 +167,7 @@ export class StartEditController extends Disposable {

const { position, documentLayoutObject, scaleX, editorUnitId } = editCellState;
const editorObject = this._getEditorObject();
if (editorObject == null) {
if (editorObject == null || this._contextService.getContextValue(FOCUSING_EDITOR_STANDALONE) === true || this._contextService.getContextValue(FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE) === true) {
return;
}

Expand Down

0 comments on commit 0831994

Please sign in to comment.