emilhe / dash-extensions

The dash-extensions package is a collection of utility functions, syntax extensions, and Dash components that aim to improve the Dash development experience
https://www.dash-extensions.com/
MIT License
409 stars 58 forks source link

Mermaid causes error in Dash Plotly app due to invalid selector starting with digit. #270

Closed lucdh closed 1 year ago

lucdh commented 1 year ago

When trying to display a Mermaid graph in a Dash Plotly app using dash-extensions, I regularly get the following error:

Failed to execute 'querySelector' on 'Element': '#23yHh g' is not a valid selector.

The error disappears after reloading the page as soon as a selector is created that does not start with a digit. Can this be fixed by ensuring the selector is alway valid? Or is there a way to choose the selector name in the Dash code?

lucdh commented 1 year ago

I found out myself by checking the code: the 'name' property can be used to set the selector name.