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
Closed

Custom onNodeClick handler not triggering on collapsible nodes #136

LonelyPrincess opened this issue Oct 16, 2018 · 1 comment · Fixed by #137
Assignees
Labels
bug Hacktoberfest Hacktoberfest label

Comments

@LonelyPrincess
Copy link
Collaborator

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 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.
@LonelyPrincess LonelyPrincess added the Hacktoberfest Hacktoberfest label label Oct 16, 2018
danielcaldas pushed 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
Copy link
Owner

Closing with #137

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

Successfully merging a pull request may close this issue.

2 participants