FlowFuse / node-red-dashboard

https://dashboard.flowfuse.com
Apache License 2.0
204 stars 48 forks source link

State not rendering in Mermaid Charts after page navigation #263

Closed joepavitt closed 1 year ago

joepavitt commented 1 year ago

Description

First raised here: https://github.com/FlowFuse/node-red-dashboard/pull/185#issuecomment-1758656045

If you provide dynamic content into a Mermaid Chart, and then navigate away from the page and back to it, the chart does not render correctly. It does render correctly when refreshing the page.

Worth noting that the chart does appear to maintain the existing state under the covers - this was noticed as I have a dynamic mermaid chart linked to two buttons, each providing new content. If I click "Button A", navigate away, return (the chart reports syntax error), but re-clicking Button A, nothing changes. If I click "Button B", then it works.

Epic/Story

No response

Have you provided an initial effort estimate for this issue?

I have provided an initial effort estimate

joepavitt commented 1 year ago

Also noticed that if we inject the same content again, we see the same error, not sure if this is being caused by the same bug, Is suspect it is:

https://github.com/FlowFuse/node-red-dashboard/assets/99246719/6848f472-a7a2-47be-9ce3-254ddb6c4f12