fix: Only autofocus super notes when creating new note (#2063)

This commit is contained in:
Aman Harwara
2022-11-28 23:38:45 +05:30
committed by GitHub
parent 60cbd7aed2
commit 96e8dfdd31
2 changed files with 2 additions and 2 deletions

View File

@@ -2,7 +2,6 @@ import {FunctionComponent, useCallback, useState} from 'react';
import {RichTextPlugin} from '@lexical/react/LexicalRichTextPlugin';
import {ContentEditable} from '@lexical/react/LexicalContentEditable';
import {OnChangePlugin} from '@lexical/react/LexicalOnChangePlugin';
import {AutoFocusPlugin} from '@lexical/react/LexicalAutoFocusPlugin';
import {CheckListPlugin} from '@lexical/react/LexicalCheckListPlugin';
import {ClearEditorPlugin} from '@lexical/react/LexicalClearEditorPlugin';
import {MarkdownShortcutPlugin} from '@lexical/react/LexicalMarkdownShortcutPlugin';
@@ -121,7 +120,6 @@ export const BlocksEditor: FunctionComponent<BlocksEditorProps> = ({
<OnChangePlugin onChange={handleChange} ignoreSelectionChange={true} />
<HistoryPlugin />
<HorizontalRulePlugin />
<AutoFocusPlugin />
<ClearEditorPlugin />
<CheckListPlugin />
<CodeHighlightPlugin />

View File

@@ -27,6 +27,7 @@ import { useCommandService } from '@/Components/ApplicationView/CommandProvider'
import { SUPER_SHOW_MARKDOWN_PREVIEW } from '@standardnotes/ui-services'
import { SuperNoteMarkdownPreview } from './SuperNoteMarkdownPreview'
import { ExportPlugin } from './Plugins/ExportPlugin/ExportPlugin'
import { AutoFocusPlugin } from '@lexical/react/LexicalAutoFocusPlugin'
const NotePreviewCharLimit = 160
@@ -157,6 +158,7 @@ export const SuperEditor: FunctionComponent<Props> = ({
<NodeObserverPlugin nodeType={BubbleNode} onRemove={handleBubbleRemove} />
<NodeObserverPlugin nodeType={FileNode} onRemove={handleBubbleRemove} />
<ExportPlugin />
{controller.isTemplateNote ? <AutoFocusPlugin /> : null}
</BlocksEditor>
</BlocksEditorComposer>
</FilesControllerProvider>