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

Decoration Types doesnt match what gets passed for node views #3772

Closed
2 tasks done
marclave opened this issue Feb 21, 2023 · 0 comments · Fixed by #3783
Closed
2 tasks done

Decoration Types doesnt match what gets passed for node views #3772

marclave opened this issue Feb 21, 2023 · 0 comments · Fixed by #3783
Labels
Type: Bug The issue or pullrequest is related to a bug

Comments

@marclave
Copy link

What’s the bug you are facing?

NodeViewProps has Decorations which is an Decoration[], when we iterate over the Decorations we actually see

{ to, from, type } 

instead of the actual typing described in @tiptap/pm/view, so we get type errors when we want to check if has-focus decoration is active per node

Which browser was this experienced in? Are any special extensions installed?

All browsers :)

How can we reproduce the bug on our side?

add a new paragraph, check console and you should see this

https://codesandbox.io/s/nice-cdn-6ktib5?file=/src/App.vue

image

logged from the custom paragraph component

  mounted() {
    if (this.decorations) {
      console.log(this.decorations);
    }
  },

Can you provide a CodeSandbox?

https://codesandbox.io/s/nice-cdn-6ktib5?file=/src/App.vue

What did you expect to happen?

the type should match the type in { to, from, type } instead of the actual typing described in @tiptap/pm/view

Anything to add? (optional)

No response

Did you update your dependencies?

  • Yes, I’ve updated my dependencies to use the latest version of all packages.

Are you sponsoring us?

  • Yes, I’m a sponsor. 💖
@marclave marclave added the Type: Bug The issue or pullrequest is related to a bug label Feb 21, 2023
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

Successfully merging a pull request may close this issue.

1 participant