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

[PRO]: hoverThread and leaveThread not working in Svelte or Vue #6242

Open
1 task done
a4vg opened this issue Apr 6, 2025 · 1 comment
Open
1 task done

[PRO]: hoverThread and leaveThread not working in Svelte or Vue #6242

a4vg opened this issue Apr 6, 2025 · 1 comment
Labels
Category: Pro The issue or pull request is related to the pro packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug

Comments

@a4vg
Copy link

a4vg commented Apr 6, 2025

Affected Packages

extension-comments

Version(s)

2.17.6

Description of the Bug

Using the functions from the documentation to handle hover events raises an error in Svelte:

const onHoverThread = (threadId) => {
  const { tr } = editor.state

  tr.setMeta('threadMouseOver', threadId)
  editor.view.dispatch(tr)
}

const onUnhoverThread = (threadId) => {
  const { tr } = editor.state

  tr.setMeta('threadMouseOut', threadId)
  editor.view.dispatch(tr)
}
TypeError: s.getMeta(...).forEach is not a function

The example provided in for Vue in the docs is also failing with the same error when hovering a thread.
Image

I tried passing an array of ids instead of a single one. The error mentioned disappeared but now nothing happens.

Browser Used

Chrome

Code Example (Preferred)

https://tiptap.dev/docs/comments/getting-started/install#integrating-the-comments-extension

Expected Behavior

Get the thread content wrapped in a .tiptap-thread--hovered class in the editor.

Additional Context (Optional)

The example for React uses the utils functions from the Tiptap library hoverThread and hoverOffThread and it works. After inspecting this functions I found:

  • It uses the same metadata as Vue and Svelte (threadMouseOver and threadMouseOut) but it passes an array of thread IDs, instead of a single id (as incorrectly shown in the docs).
  • According to the Typescript declarations, the array of thread ids is number[]. The thread IDs should be of type string, they are uuids and that's the type in TCollabThread['id'].

Dependency Updates

  • Yes, I've updated all my dependencies.
@a4vg a4vg added Category: Pro The issue or pull request is related to the pro packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug labels Apr 6, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Tiptap: Issues Apr 6, 2025
@a4vg
Copy link
Author

a4vg commented Apr 7, 2025

Clicking on the thread content in the editor doesn't work either for Svelte or Vue.

From the example in the docs:

  • React
    Image

  • Vue
    Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Pro The issue or pull request is related to the pro packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug
Projects
Status: Needs Triage
Development

No branches or pull requests

1 participant