Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useEmoji doesn't work with TablePresent and NodeExtension #765

Open
ronnyroeller opened this issue Nov 3, 2020 · 0 comments
Open

useEmoji doesn't work with TablePresent and NodeExtension #765

ronnyroeller opened this issue Nov 3, 2020 · 0 comments
Labels
status: confirmed 🟢 The bug has been tested and confirmed. type: bug 🪲 Something isn't working
Projects

Comments

@ronnyroeller
Copy link
Collaborator

ronnyroeller commented Nov 3, 2020

Summary

I'm using useEmoji in an editor that uses also TablePresent and a custom NodeExtension. If the editor content contains an instance of the custom NodeExtension, pressing : makes the editor loose the focus.

Steps to reproduce

  1. Open reproduction case: https://codesandbox.io/s/silent-sunset-qsdvy
  2. Enter : at the end of the first line (i.e. above the custom NodeExtension)
  3. Click again directly after the colon character.

Here is a recording of the reproduction scenario in codesandbox: https://discord.com/channels/726035064831344711/745695521305526302/773204651490672711

Expected results

The editor looses the focus.

Actual results

The editor should allow to type further the emoji name.

The reproduction case does work if TablePreset isn't added or if there is no instance of NodeExtension in the document.

Possible Solution

useEmoji ejects with reason move-end. This is caused by this block in prosemirror-suggest:

if ($pos.pos > match.range.to) {

Further debugging showed that the cursor gets automatically positioned to the end of the document (instead of where the colon is). I couldn't find out what is moving the cursor to there.

@ronnyroeller ronnyroeller added the type: bug 🪲 Something isn't working label Nov 3, 2020
@ifiokjr ifiokjr added the status: confirmed 🟢 The bug has been tested and confirmed. label Nov 4, 2020
@ifiokjr ifiokjr added this to Needs triage in Bugs via automation Nov 4, 2020
@ifiokjr ifiokjr moved this from Needs triage to Default Priority in Bugs Nov 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: confirmed 🟢 The bug has been tested and confirmed. type: bug 🪲 Something isn't working
Projects
Bugs
  
Default Priority
Development

No branches or pull requests

2 participants