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

App crashes when emitting nodeselect event #556

Closed
jtwnel opened this issue Nov 15, 2021 · 2 comments
Closed

App crashes when emitting nodeselect event #556

jtwnel opened this issue Nov 15, 2021 · 2 comments

Comments

@jtwnel
Copy link

jtwnel commented Nov 15, 2021

Hi,

I tried to trigger the "nodeselect" event on the "nodecreated" event handler but it crashes saying the following error
Unhandled Rejection (Error): Node not exist in list. How is this possible? if the node is already visible it does not make sense to get this error.

this is a snippet of what i'm trying to do

editor.current.on('nodecreated', (node) => { function_calls... editor.current.trigger('selectnode', node); });

Thanks in advance

@Ni55aN
Copy link
Member

Ni55aN commented Nov 16, 2021

Definitely, the node was deleted before triggering selectnode, since nodes array doesn't have this node anymore

rete/src/editor.ts

Lines 85 to 87 in 6bdec4f

selectNode(node: Node, accumulate: boolean = false) {
if (this.nodes.indexOf(node) === -1)
throw new Error('Node not exist in list');

@Ni55aN Ni55aN added the v1 label Apr 4, 2023
@rete-js
Copy link
Contributor

rete-js bot commented Jul 13, 2023

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@rete-js rete-js bot added the Stale label Jul 13, 2023
@rete-js rete-js bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants