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 hover on orphan node #50

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion examples/events/interactionEvents/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ var nodes = new vis.DataSet([
{ id: 2, label: 'Node 2', title: 'I have a popup!' },
{ id: 3, label: 'Node 3', title: 'I have a popup!' },
{ id: 4, label: 'Node 4', title: 'I have a popup!' },
{ id: 5, label: 'Node 5', title: 'I have a popup!' }
{ id: 5, label: 'Node 5', title: 'I have a popup!' },
{ id: 6, label: 'Node 6', title: 'I have a popup!' }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Tav0, so I tested this new example data on master (without the fix) and I am not able to reproduce the bug. can you tell me more about when you see the bug (see hover broken)?

Could you perhaps add another example to the PR that will show the bug if the fix is not present?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some more details on what I tried in this issue #51

])

// create an array with edges
Expand Down
2 changes: 1 addition & 1 deletion lib/network/modules/SelectionHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ class SelectionHandler {
hoveredEdgesCount === 0 &&
hoveredNodesCount === 0

if (hoverChanged || newOnlyHoveredEdge) {
if (hoverChanged || newOnlyHoveredEdge || object.id) {
hoverChanged = this.emitHoverEvent(event, pointer, object)
}

Expand Down