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

Custom onNodeClick handler not triggering on collapsible nodes #136

Closed
LonelyPrincess opened this issue Oct 16, 2018 · 1 comment · Fixed by #137
Assignees

Comments

@LonelyPrincess
Copy link
Collaborator

@LonelyPrincess LonelyPrincess commented Oct 16, 2018

Right now, if the collapsible feature is enabled, the user defined onNodeClick handler is never called. This is due to a typo in the _tick method implementation (in Graph component).

@LonelyPrincess LonelyPrincess added the bug label Oct 16, 2018
@LonelyPrincess LonelyPrincess self-assigned this Oct 16, 2018
LonelyPrincess added a commit that referenced this issue Oct 16, 2018
There was a mistake in the `_tick` method which caused the user's
`onNodeClick` custom handler to never be triggered when the collapsible
feature was enabled.

The problem was that it called `setState` without using a callback
parameter if the received `cb` was not empty. The contents of that
ternary operator should be the opposite for things to work.

This fix closes #136.
danielcaldas added a commit that referenced this issue Oct 16, 2018
* fix: Trigger custom click handler in collapsible nodes

There was a mistake in the `_tick` method which caused the user's
`onNodeClick` custom handler to never be triggered when the collapsible
feature was enabled.

The problem was that it called `setState` without using a callback
parameter if the received `cb` was not empty. The contents of that
ternary operator should be the opposite for things to work.

This fix closes #136.

* Add e2e test for node click callback
@danielcaldas

This comment has been minimized.

Copy link
Owner

@danielcaldas danielcaldas commented Oct 16, 2018

Closing with #137

zvolchak added a commit to zvolchak/react-d3-graph that referenced this issue Oct 29, 2018
)

* fix: Trigger custom click handler in collapsible nodes

There was a mistake in the `_tick` method which caused the user's
`onNodeClick` custom handler to never be triggered when the collapsible
feature was enabled.

The problem was that it called `setState` without using a callback
parameter if the received `cb` was not empty. The contents of that
ternary operator should be the opposite for things to work.

This fix closes danielcaldas#136.

* Add e2e test for node click callback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.