Closed braincore closed 2 months ago
As a workaround, setMarkdown()
can be called prior to calling focus()
. However, setMarkdown()
must have contents (at least temporarily)! To avoid any visual artifacts, one can do the following:
mdxEditorRef.current.setMarkdown("  ");
mdxEditorRef.current.setMarkdown("");
If you want to ask for support or request features, sponsor the project and contact me over email.
Describe the bug If an editor is initialized with prop
markdown=""
, then a call editor methodfocus()
will fail to focus the editor.Reproduction Sandbox: Simply click "Test focus"
Expected behavior Editor should be brought to focus with blinking cursor at start index.
Additional context This issue came up in the context of calling "focus()" from a mobile-web interface to bring up the virtual keyboard.