Closed athioak7 closed 3 weeks ago
@athioak7 alternative:
from dash import Dash, html, Input, Output
import feffery_antd_components as fac
import feffery_markdown_components as fmc
app = Dash(__name__)
app.layout = html.Div(
[
fac.AntdInput(
value="""def sum(a, b):
return a+b
sum(2,2)""",
id="codeta",
mode="text-area",
autoSize={"minRows": 6, "maxRows": 6},
),
fmc.FefferyMarkdown(id="markdown", codeTheme="a11y-dark"),
]
)
@app.callback(Output("markdown", "markdownStr"), Input("codeta", "value"))
def update_markdown(value) -> str:
return f"```python\n\n{value}\n\n```"
if __name__ == "__main__":
app.run(debug=True)
related documentations:
https://fmc.feffery.tech/change-code-theme https://fac.feffery.tech/AntdInput
Hi @athioak7
Thanks for reporting. This has been noted in the dash-docs as well. This was working prior to dash 2.15 and may be related to https://github.com/plotly/dash/pull/2721
Not related to #2721, that was for the python stacktrace not on component level.
I have a dcc.Markdown that I want to update based on user input in a Textarea. Everything works correctly besides the code component, which when edited stops showing the correct colors (and upon further inspection does not assign the correct classes in the html code).
Expected: The markdown should update the code component properly.
Environment:
Minimal reproducible example:
markdown_bug