I have the following code that uses the Dash Mantine Component Modal:
dmc.Modal(
title="Snapshot",
id="modal-simple",
zIndex=10000,
children=\[
html.Div(
dcc.Textarea(id='snap-comment',style={'width': '70%', 'height': 100}),
),
html.Span(id='take-snapshot-status', style={'paddingRight': 10}),
dmc.Space(h=20),
dmc.Group(
\[
dmc.Button("Take Snapshot", id="take-snapshot"),
dmc.Button(
"Close",
color="red",
variant="outline",
id="modal-close-button",
),
\],
align="right",
),
\],
)
and the following callback for it:
@app.callback(
Output("modal-simple", "opened"),
Input("snap-modal-button", "n_clicks"),
Input("modal-close-button", "n_clicks"),
Input("take-snapshot", "n_clicks"),
State("modal-simple", "opened"),
prevent_initial_call=True,
)
def modal_demo(nc1, nc2, nc3, opened):
return not opened
This has been working for me for months and all of a sudden when I open the modal and close it, the backdrop that comes up when opened becomes darker and stays until the app is refreshed. Any recommendations to fix this would be greatly appreciated.