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

Unstable bug - can't render hidden nodes with centered text in Firefox #6022

Open
GoulartNogueira opened this issue Nov 4, 2024 · 0 comments
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect

Comments

@GoulartNogueira
Copy link

Description

Mermaid fails on rendering with hidden nodes
Very unstable bug. Shows up while changing unrelated nodes.

View fail Error: Could not find a suitable point for the given distance

Steps to reproduce

  1. Open the Code Sample at https://mermaid.live / Firefox:

  2. When adding a text in any centralized link, the mermaid breaks.

  3. Console show error:
    view fail Error: Could not find a suitable point for the given distance

flowchart TD
        A --> |text| hide:::hidden
        hide --> B
        hide --> |text| C
        hide --> D
Loading

If you remove both |text| it runs fine.
If you break symmetry, it also runs fine:

flowchart TD
        A --> hide:::hidden
        hide --> B
        hide --> |text| C
        hide --> D
        hide --> E
Loading

https://mermaid.live/edit#pako:eNptjz0OwjAMRq8SeW4vkIEBysgEE8piNW4TqUmq4Kigtncn_UEs9WL76VnWN0IdNIGEpgtDbTCyeFTKi73OoixPYnpPwlhNUsrcNPm_sODVuRyw5a464NeNQQGOokOr8_9xYQrYkCMFMo-aGkwdK1B-ziomDvePr0FyTFRA6jUyVRbbiO4HSVsO8bZFWpMVEENqDcgGu1c2evTPENy-z1_Bkk2n

Screenshots

Working at Chrome (but the :::hidden style still persists the geometry)
image

Fails at Firefox when I try to add a text anywhere in the central row
image

Code Sample

flowchart TD
        A --> hide:::hidden
        hide --> B
        hide --> |text| C
        hide --> D


https://mermaid.live/edit#pako:eNptj70OwjAMhF8l8ty-QAYGKCMTTCiL1bhNpCapgqOC2r476Q9iqRfb3510uhHqoAkkNF0YaoORxaNSXuxzFmV5EsZqklLmpcn_xQWv-uWATe9JVAf8ujEowFF0aHXOHhemgA05UiDzqanB1LEC5edsxcTh_vE1SI6JCki9RqbKYhvR_SBpyyHetjprqwJiSK0B2WD3yo4e_TMEt__zF0SvTBc

Setup

  • Mermaid version: [Mermaidv11.3.0, Mermaidv11.3.0+ece3b25]
  • Browser and Version: Bugs only at Firefox! [Firefox - 132.0 (64-bit)] - it works fine in Chrome

Suggested Solutions

No response

Additional Context

Unsure if related:

I also noticed Firefox will collapse the height as I expected.
Chrome requires to force style hide height:0px; to achieve the same result.

flowchart TD
        B --- hide:::hidden
        hide --> C
        hide --> |text| D
        hide --> E
    
style hide height:0px;
Loading
@GoulartNogueira GoulartNogueira added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

No branches or pull requests

1 participant