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

Calling mention suggestions callback with empty list causes crash (patch included) #39

Open
macavity23 opened this issue Jun 5, 2022 · 1 comment · May be fixed by #48
Open

Calling mention suggestions callback with empty list causes crash (patch included) #39

macavity23 opened this issue Jun 5, 2022 · 1 comment · May be fixed by #48

Comments

@macavity23
Copy link

In my Mentions plugin (created using getMentionsPlugin), when getting suggestions, my code calls the done callback with an empty list to indicate no matching suggestions, but this causes a crash in mentionPlugin.js:addClassAtIndex ("prevItem is undefined" due to there being no matching element).

The patch below adds a simple check to addClassAtIndex to fix this issue, and also in related function removeClassAtIndex.

prosemirror.patch.txt

@stof
Copy link

stof commented Jul 12, 2022

you should probably open a pull request with your patch

@mzgajner mzgajner linked a pull request Apr 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants