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

this is undefined in clone method. #726

Open
1 task done
pokecheater opened this issue Jan 10, 2025 · 0 comments
Open
1 task done

this is undefined in clone method. #726

pokecheater opened this issue Jan 10, 2025 · 0 comments
Labels

Comments

@pokecheater
Copy link

pokecheater commented Jan 10, 2025

Describe the bug

Hi,

I noticed something weird. When the node.clone() method is called from your contex-menu the reference to the node itself is lost.
Therefore I am not able to create a new node with the same properties than the current one.

image

image

Example to reproduce

No response

How to reproduce

You can easily reproduce the same behaviour in your own code examples:

https://retejs.org/examples/context-menu

Just add

  clone() {
    console.log("this", this);
    return new NodeA()
  }

to the clone method and see that the reference is undefined.

image

Expected behavior

The reference to the node that should be cloned should not be lost.

Dependencies

"rete": "^2.0.5",
"rete-area-plugin": "^2.1.3",
"rete-connection-plugin": "^2.0.5",
"rete-context-menu-plugin": "^2.0.4",
"rete-render-utils": "^2.0.3",
"rete-vue-plugin": "^2.1.1",
"rete-vue-render-plugin": "^0.5.2",

Platform

brave Version 1.73.97 Chromium: 131.0.6778.108 (Offizieller Build) (arm64)

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant