Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
notebooks: fix cursor jumping and color in markdown blocks (#34227)
Browse files Browse the repository at this point in the history
  • Loading branch information
limitedmage authored and coury-clark committed Apr 26, 2022
1 parent 59cc7f0 commit da6609f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

:global(.cm-content) {
font-family: var(--code-font-family);
caret-color: var(--body-color);
}

:global(.cm-scroller) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,13 @@ const staticExtensions: Extension[] = [
]

function focusInput(editor: EditorView): void {
editor.focus()
editor.dispatch({
selection: { anchor: editor.state.doc.length },
scrollIntoView: true,
})
if (!editor.hasFocus) {
editor.focus()
editor.dispatch({
selection: { anchor: editor.state.doc.length },
scrollIntoView: true,
})
}
}

interface NotebookMarkdownBlockProps extends BlockProps<MarkdownBlock>, ThemeProps {
Expand Down

0 comments on commit da6609f

Please sign in to comment.