Skip to content

Flowcharts: When securityLevel: "loose" is not specified, "click" fails quietly without a warning #6809

@PetrLaskevic

Description

@PetrLaskevic

Description

With this diagram:

flowchart LR
getOriginalTrack
untranslateAudioTrack --> getOriginalTrack
untranslate --> untranslateAudioTrack
MutationObserver:133 --> untranslate
A[top level]
click getOriginalTrack call callback()
click untranslateAudioTrack call callback()
click untranslate call callback()
click MutationObserver:133 call callback()
click A call callback()

and callback defined as:

  window.callback = function(){
    console.log("nice");
  }

Actual behaviour:

The callback did not get fired, and did not give any error or warning, but failed quietly. This is unhelpful for debugging.

Expected behaviour:

There is a warning that Click event callback calls are ignored because securityLevel is not "loose" in Mermaid config

Steps to reproduce

  1. Take your mermaid-live-editor as base
  2. Add the callback to its View.svelte
  3. put this diagram in the editor

Screenshots

No response

Code Sample


Setup

  • Mermaid version:
  • Browser and Version: [Chrome, Edge, Firefox]

Suggested Solutions

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions