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

prosemirror-autocomplete: backspace bug? #183

Open
tslocke opened this issue Mar 7, 2023 · 1 comment
Open

prosemirror-autocomplete: backspace bug? #183

tslocke opened this issue Mar 7, 2023 · 1 comment

Comments

@tslocke
Copy link
Contributor

tslocke commented Mar 7, 2023

What is the boolean returned from the reducer for? I figured returning false would mean something like "nothing happened".

I have an autocomplete menu that is only valid in some contexts. In other contexts, typing the trigger character should just behave like normal typing.

That is all working fine except for one small niggle: after typing the trigger character I have to press backspace twice to delete it. If the menu was open, the first backspace would close the menu, so it seems like the plugin is behaving as if the menu is open.

Not sure if I am using the API wrongly or if this is a little bug.

@tslocke
Copy link
Contributor Author

tslocke commented Mar 7, 2023

In addition to the backspace issue, it's also not possible to open another menu by typing a different trigger.

But I figured out I can solve the problem by calling closeAutocomplete before returning false.

So I'm all good, but I wonder if returning false from the reducer on an open action should behave like that by default?

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

No branches or pull requests

1 participant