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

Mention list opens in wrong place initially when using async items function #1782

Closed
jamesmoss opened this issue Aug 23, 2021 · 0 comments
Closed
Labels
Type: Bug The issue or pullrequest is related to a bug

Comments

@jamesmoss
Copy link

jamesmoss commented Aug 23, 2021

Description
If you're making an async request to the server in the mentions plugin, it's possible to get the mention list to appear in the wrong place.

Steps to reproduce the bug
Steps to reproduce the behavior:

  1. Type @ to open the mentions list
  2. Quickly type a letter before the items function has time to resolve. e.g @a
  3. You'll notice for a split second the mentions list appears in the top left before snapping to the correct place

CodeSandbox
I created a CodeSandbox to help you debug the issue, it's using the code from the mentions docs except I've added a setTimeout which emulates a 300ms response time from the server.

Expected behavior
The mention list always appears next to the cursor.

Screenshot, video, or GIF

Environment?

  • operating system: MacOS
  • browser: Chrome 92
  • mobile/desktop: Desktop
  • tiptap version: @tiptap/[email protected]

Additional context
Add any other context about the problem here.

@jamesmoss jamesmoss added Type: Bug The issue or pullrequest is related to a bug v2 labels Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug The issue or pullrequest is related to a bug
Projects
None yet
Development

No branches or pull requests

1 participant