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

Can not get click event to fire. #306

Closed
eddiex opened this issue Feb 19, 2016 · 6 comments
Closed

Can not get click event to fire. #306

eddiex opened this issue Feb 19, 2016 · 6 comments

Comments

@eddiex
Copy link

eddiex commented Feb 19, 2016

I am having a hard time getting any click events to fire in the below simple example. Can you please have a look and advise what I am missing?

The console (chrome) is showing empty bind functions...
screenshot_021816_102951_pm

The code I am running is here... (I renamed html to txt for upload)
mermaid4.txt

Sincere Thanks,
Ed

@knsv
Copy link
Collaborator

knsv commented Feb 21, 2016

Hello Ed!

Your example was pretty much ok but for one small omission. You need to pass the element to the bind events function. This helps when you set events for several diagrams.

bindEvents($("#div-id1")[0]);

I hope this helps.

@eddiex
Copy link
Author

eddiex commented Feb 21, 2016

Great. Thank you very much.

@arifA9
Copy link

arifA9 commented Oct 9, 2017

Thanks Alot, this really help me

@a1anw2
Copy link

a1anw2 commented Oct 11, 2017

It helped me a lot too ... which does highlight that many of the examples in the documentation is wrong or outdated. Love this project.

@a1anw2
Copy link

a1anw2 commented Oct 12, 2017

One bug I have noticed is that the ID for a node cannot start with a numeric if you wish the click event to fire.

graph TB
ab92aedcf2c02100b1a1690bc8aea5a1c876da3f1 --> 620794c281f0501b17cec8fc1e417869dcd04bce
ab92aedcf2c02100b1a1690bc8aea5a1c876da3f1[Ocean - Wikipedia]
620794c281f0501b17cec8fc1e417869dcd04bce[New Tab]
click ab92aedcf2c02100b1a1690bc8aea5a1c876da3f1 "https://en.m.wikipedia.org/wiki/Ocean"
click 620794c281f0501b17cec8fc1e417869dcd04bce "https://www.google.com/_/chrome/newtab?espv=2&ie=UTF-8"

where as, if you add a letter at the start, then this works:

graph TB
ab92aedcf2c02100b1a1690bc8aea5a1c876da3f1 --> a620794c281f0501b17cec8fc1e417869dcd04bce
ab92aedcf2c02100b1a1690bc8aea5a1c876da3f1[Ocean - Wikipedia]
a620794c281f0501b17cec8fc1e417869dcd04bce[New Tab]
click ab92aedcf2c02100b1a1690bc8aea5a1c876da3f1 "https://en.m.wikipedia.org/wiki/Ocean"
click a620794c281f0501b17cec8fc1e417869dcd04bce "https://www.google.com/_/chrome/newtab?espv=2&ie=UTF-8"

@tylerlong
Copy link
Collaborator

tylerlong commented Mar 17, 2018

@a1anw2 I have confirmed the bug you reported and I've fixed it.

mgenereu pushed a commit to mgenereu/mermaid that referenced this issue Jun 25, 2022
…yarn/develop/svelte-3.42.2

chore(deps-dev): bump svelte from 3.42.1 to 3.42.2
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

5 participants