Skip to content

Fix Composer deleting text before submitting

Alex Gleason requested to merge fix-1618 into main

Fixes #1618 (closed)

  • Prevent the Submit button from being clicked if it would cause this bug (check presence of editorRef.current and text.length)
  • Autofocus the LexicalEditor on mobile

In order for the editorRef to be set, it seems that the editor needs to become focused. So it makes sense to just autofocus it on mobile when it mounts. I don't really understand why it's needed, but between the two of these things (preventing the submit, and autofocus), it fixes the bug.

Merge request reports