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

use onClick inside node component instead onNodeClick function #363

Open
vini-sakai opened this issue Feb 27, 2024 · 2 comments
Open

use onClick inside node component instead onNodeClick function #363

vini-sakai opened this issue Feb 27, 2024 · 2 comments

Comments

@vini-sakai
Copy link

vini-sakai commented Feb 27, 2024

Hi, I'm using the lib to display a business organizational chart but I'm heaving trouble using an onClick function inside my node component button (I have 2 buttons inside node). The function is never called, and the function onNodeClick not works for the buttons. How can I do this? :))

Here is one of buttons:

<ThreeDotsContainer permission={permission}>
            <Icons
              name="IconDotsVertical"
              width={"16px"}
              color="#53464F"
              onClick={(e) => {
                handleClickEdit(e);
              }}
            />
</ThreeDotsContainer>
@bumbeishvili
Copy link
Owner

@vini-sakai can you reproduce the issue with the live sample?

Feel free to fork any of the samples

https://github.com/bumbeishvili/org-chart?tab=readme-ov-file#features

@vini-sakai
Copy link
Author

vini-sakai commented Feb 27, 2024

@bumbeishvili , I picked the react sample because I'm using react to build the project.
here's the forked sample:
https://stackblitz.com/edit/d3-org-chart-react-integration-hooks-3pa9lm?file=OrgChart.js

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

No branches or pull requests

2 participants