Skip to content

Commit 3c8ccf5

Browse files
josh-ramos-22Josh Ramos
andauthored
[WEB-30] [EDITOR] inserting block immediately focuses input (#344)
* First attempt to autofocus on new blocks using forward refs * Finished problem by adding autofocus prop to Editable component * Removed code related to old implementation of autofocus --------- Co-authored-by: Josh Ramos <[email protected]>
1 parent 4a7f9a2 commit 3c8ccf5

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

frontend/src/packages/editor/components/EditorBlock.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ const EditorBlock: FC<CMSBlockProps> = ({
112112
onClick={() => onEditorClick()}
113113
style={{ width: '100%', height: '100%' }}
114114
onKeyDown={(event) => handleKey(event, editor)}
115+
autoFocus
115116
/>
116117
</ContentBlock>
117118
</Slate>

frontend/src/packages/editor/components/HeadingBlock.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ const HeadingBlock: FC<CMSBlockProps> = ({
6565
onClick={() => onEditorClick()}
6666
style={{ width: "100%", height: "100%" }}
6767
onKeyDown={(event) => handleKey(event, editor)}
68+
autoFocus
6869
/>
6970
</ContentBlock>
7071
</Slate>

0 commit comments

Comments
 (0)