diff --git a/src/examples/basics.tsx b/src/examples/basics.tsx index f4638f39..1116911d 100644 --- a/src/examples/basics.tsx +++ b/src/examples/basics.tsx @@ -45,6 +45,16 @@ export function Bare() { ) } +export function FocusEmpty() { + const ref = React.useRef(null) + return ( + <> + + + + ) +} + export function Placeholder() { return ( <> diff --git a/src/plugins/core/index.ts b/src/plugins/core/index.ts index 90fe2620..0caf0104 100644 --- a/src/plugins/core/index.ts +++ b/src/plugins/core/index.ts @@ -898,10 +898,8 @@ export const corePlugin = realmPlugin<{ }) newEditor.update(() => { - const markdown = params?.initialMarkdown.trim() - if (markdown) { - tryImportingMarkdown(r, $getRoot(), markdown) - } + const markdown = params?.initialMarkdown.trim() ?? '' + tryImportingMarkdown(r, $getRoot(), markdown) const autoFocusValue = params?.autoFocus if (autoFocusValue) {