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

[Bug]: The PluginView be trigger destroy on create Tiptap instance. #5681

Closed
1 task done
yangfuhai opened this issue Sep 30, 2024 · 2 comments
Closed
1 task done

[Bug]: The PluginView be trigger destroy on create Tiptap instance. #5681

yangfuhai opened this issue Sep 30, 2024 · 2 comments
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug

Comments

@yangfuhai
Copy link

Affected Packages

core

Version(s)

2.7.4

Bug Description

export const MyExtension = Extension.create<ClickMenuOptions>({
  name: "MyExtension",
  addProseMirrorPlugins() {
    const destroy = () => {
      console.log("destroy!!!!")
    }
    return [
      new Plugin({
        key: new PluginKey(`MyExtension`),
        view: () => ({ destroy }),
      }),
    ];
  },
});

the method destroy will be invoked twice in Tiptap create.

ps: This problem does not exist in tiptap v2.6x.

Browser Used

Chrome

Code Example URL

No response

Expected Behavior

the destory method not be trigger in tiptap create.

Additional Context (Optional)

No response

Dependency Updates

  • Yes, I've updated all my dependencies.
@yangfuhai yangfuhai added Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug labels Sep 30, 2024
@nperez0111
Copy link
Contributor

Thanks for bringing this up. Was the new onDrop & onPaste events that were always registering, I have a fix in this #5684

@nperez0111
Copy link
Contributor

This has been released with tiptap v2.8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug
Projects
None yet
Development

No branches or pull requests

2 participants