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

fix: Trigger custom click handler in collapsible nodes #137

Merged
merged 2 commits into from Oct 16, 2018

Conversation

@LonelyPrincess
Copy link
Collaborator

LonelyPrincess commented Oct 16, 2018

There was a mistake in the _tick method which caused the user's
onClickNode 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 and others added 2 commits 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

This comment has been minimized.

Copy link
Owner

danielcaldas commented Oct 16, 2018

My bad! 😓 🔥 Just added a e2e test to ensure the functionality

@danielcaldas danielcaldas merged commit 9bbf5b7 into master Oct 16, 2018
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@danielcaldas danielcaldas deleted the fix/collapsible-custom-click branch Oct 16, 2018
zvolchak added a commit to zvolchak/react-d3-graph that referenced this pull request 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.