Skip to content

Commit ecc9845

Browse files
Merge pull request #11282 from gitbutlerapp/rich-text-editor-autofocus
Auto-focus codegen input
2 parents c62a67e + 11766d1 commit ecc9845

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

apps/desktop/src/components/editor/MessageEditor.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@
340340
monospaceFont={$userSettings.diffFont}
341341
tabSize={$userSettings.tabSize}
342342
enableLigatures={$userSettings.diffLigatures}
343+
autoFocus={false}
343344
>
344345
{#snippet plugins()}
345346
<Formatter bind:this={formatter} />

packages/ui/src/lib/richText/RichTextEditor.svelte

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
monospaceFont?: string;
6565
tabSize?: number;
6666
enableLigatures?: boolean;
67+
autoFocus?: boolean;
6768
}
6869
6970
let {
@@ -87,7 +88,8 @@
8788
useMonospaceFont,
8889
monospaceFont,
8990
tabSize,
90-
enableLigatures
91+
enableLigatures,
92+
autoFocus = true
9193
}: Props = $props();
9294
9395
/** Standard configuration for our commit message editor. */
@@ -321,7 +323,6 @@
321323
<CodeBlockTypeAhead />
322324
<MarkdownShortcutPlugin transformers={[INLINE_CODE_TRANSFORMER, PARAGRAPH_TRANSFORMER]} />
323325
{:else}
324-
<AutoFocusPlugin />
325326
<AutoLinkPlugin />
326327
<CheckListPlugin />
327328
<CodeActionMenuPlugin anchorElem={editorDiv} />
@@ -333,6 +334,9 @@
333334
<MarkdownShortcutPlugin transformers={ALL_TRANSFORMERS} />
334335
<RichTextPlugin />
335336
{/if}
337+
{#if autoFocus}
338+
<AutoFocusPlugin />
339+
{/if}
336340
<HistoryPlugin />
337341

338342
{#if plugins}

0 commit comments

Comments
 (0)