SlateJS - Mention unable to continue typing after focus and cannot copy mention when focused by mouse click

786 Views Asked by At

I'm new to Slate JS and trying to implement a rich text editor with mention-functionality like Slack, Discord etc.

The current mention example (here: mentions) has some limitations that I haven't managed to solve yet, for example:

  1. When the mention is focused, one cannot type anything else in the editor, i.e. one has to use the arrows and if the mention node is the last child in the editor not even the right arrow will work.
  2. Copy paste doesn't seem to work properly either. One has to select/click on the beginning of the mention (or step to it with arrows) to copy.
  3. It doesn't support text modification of the mention after insertion.

I've haven't found any examples with solutions to these limitations so I wonder if someone has any or can help me with these? I've also asked in their Slack channel but haven't got any answers yet.

Other limitations but that I managed to solve (codesandbox) are:

  1. It doesn't accept spaces. It can be useful to filter out by last names etc.
  2. After insert, the mention is focused. Instead I wish to put the cursor after the mention and don't focus on the mention.
0

There are 0 best solutions below