Skip to content

Commit

Permalink
keep live mode on blur (#6615)
Browse files Browse the repository at this point in the history
#6593 Aggressively switches to edit mode on blur, but we only want that
to happen if the user is in insert mode (which means a draw-to-insert
interaction).

**Fix**
only switch to edit mode if the current mode is insert mode
  • Loading branch information
balazsbajorics authored and liady committed Dec 13, 2024
1 parent d32712f commit 9b4057d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion editor/src/templates/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -410,11 +410,15 @@ export class Editor {
}

resetStateOnBlur = (): void => {
const currentMode = this.storedState.patchedEditor.mode

this.boundDispatch(
[
EditorActions.clearHighlightedViews(),
CanvasActions.clearInteractionSession(false),
EditorActions.switchEditorMode(EditorModes.selectMode(null, false, 'none')),
...(currentMode.type === 'insert'
? [EditorActions.switchEditorMode(EditorModes.selectMode(null, false, 'none'))]
: []),
EditorActions.updateKeys({}),
EditorActions.closePopup(),
EditorActions.clearPostActionData(),
Expand Down

0 comments on commit 9b4057d

Please sign in to comment.