Closed GRASBOCK closed 1 month ago
The function needs to be attached to window object.
- const callback = function () {
+ window.callback = function () {
alert('A callback was triggered');
};
const config = {
startOnLoad: true,
flowchart: { useMaxWidth: true, htmlLabels: true, curve: 'cardinal' },
securityLevel: 'loose',
};
mermaid.initialize(config);
Thanks! That works. I made the change in the jsfiddle here and a pull request https://github.com/mermaid-js/mermaid/pull/5517
Description
When I want to execute the jsfiddle on flowchart interaction, but when I press on Node A or C (which use the callback function), the script fails with the error (browser devtools console error):
Not just in the jsfiddle, also locally when taking the example from the docs and adding the mermaid import:
which in the browser gives following console error:
The nodes are the most
Steps to reproduce
"Script error."
or in devtoolsUncaught
TypeError: m[v] is not a function`Screenshots
Code Sample
Setup
Suggested Solutions
No response
Additional Context
No response