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

Event listeners are not supported on html label elements #68

Open
sniperact opened this issue Apr 25, 2022 · 2 comments
Open

Event listeners are not supported on html label elements #68

sniperact opened this issue Apr 25, 2022 · 2 comments

Comments

@sniperact
Copy link

sniperact commented Apr 25, 2022

Cytoscape canvas is preventing Dom actions on html label elements

My Requirement is simple :

  1. I need a html label support on a node - Done
  2. I need to show a dropdown on hovering it - Done
  3. I need to capture click event for each dropdown item - Challenging part
  4. The event is actually captured by cytoscape canvas, I need to stop that too

Got the html label support by using this cytoscape node html label.
Unfortunately, DOM events are not listening on html label but, i had captured the hover functionality by mouseover event supported in cytoscape.
And here comes the thrill to capture the click event on dropdown item.

Kindly suggest me some good idea on how to capture the click event on hovered item

@sniperact sniperact changed the title Event listeners are supported on html label elements Event listeners are not supported on html label elements Apr 26, 2022
@nidhimittal90
Copy link

How did you show a dropdown on hovering over htmlnodelabel ? I have similar requirement and stuck at this point.

@tobystokes
Copy link

As per the README:

To make links clickable inside your labels, you need to pass enablePointerEvents: true as the 3rd argument to nodeHtmlLabel:

cyInstance.nodeHtmlLabel([
  {
    ...
  }
], {
  enablePointerEvents: true
});

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

3 participants