From e4a2a8e56d3a337b6b5c9fad0ca980b76a480147 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 8 Jul 2025 16:23:58 +0300 Subject: [PATCH] fix(text): selection and cursor not maintained properly when switching tabs --- apps/client/src/widgets/type_widgets/editable_text.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/client/src/widgets/type_widgets/editable_text.ts b/apps/client/src/widgets/type_widgets/editable_text.ts index 3bb5754a2..e1163e2b5 100644 --- a/apps/client/src/widgets/type_widgets/editable_text.ts +++ b/apps/client/src/widgets/type_widgets/editable_text.ts @@ -265,7 +265,12 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget { } focus() { - this.$editor.trigger("focus"); + const editor = this.watchdog.editor; + if (editor) { + editor.editing.view.focus(); + } else { + this.$editor.trigger("focus"); + } } scrollToEnd() {