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

Add handlers to custom node element #372

Conversation

lucasdellabella
Copy link
Contributor

@lucasdellabella lucasdellabella commented Jan 10, 2022

renderCustomNodeElement should have access to all the relevant handlers, as far as i can tell. as such, here's my changes

For context, I'm trying to write my own node renderer and I also want to add onNodeMouseOver and Out handlers.

@lucasdellabella lucasdellabella changed the title Add handlers to custom node elment Add handlers to custom node element Jan 10, 2022
src/Node/index.tsx Outdated Show resolved Hide resolved
src/Node/index.tsx Outdated Show resolved Hide resolved
@bkrem
Copy link
Owner

bkrem commented Jan 11, 2022

Thanks for pointing this out!

This is one of those where I'm sure I had a good reason for omitting the default event handlers from being passed at the time, but in retrospect I don't see why 😅

Once tests pass I'm happy to merge this, update types etc, and then publish as a fix 👍

@lucasdellabella
Copy link
Contributor Author

hey @bkrem got around to making the change, thanks for paying attention to my PR. I need to access the refs outside the tree so I can write a utility that allows the user to move the canvas around to different nodes around the tree. Whats the best way of doing this? Passing in a refGenerator() prop to the tree thats invoked and generates a ref to attach to a specific node?

Interested in hearing your thoughts.

@bkrem
Copy link
Owner

bkrem commented Jan 18, 2022

Thanks for making the adjustments here 👌 I will try to get this merged later today or tomorrow and look into your PoC regarding refs.
Haven’t had capacity for open source work the past few days.

@bkrem bkrem changed the base branch from master to fix/custom-node-events-passing January 19, 2022 20:35
@bkrem bkrem merged commit d538b08 into bkrem:fix/custom-node-events-passing Jan 19, 2022
@bkrem
Copy link
Owner

bkrem commented Jan 19, 2022

Published as v3.2.1 🚀

Thanks again :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants