Closed hwh1771 closed 2 months ago
Hi @hwh1771
Sorry for the long delay in answering. I'm unable to reproduce the issue in dmc. 0.14.4.
I'm going to close this for now, but please re-open if you have followup questions.
import dash_mantine_components as dmc
from dash import Dash, _dash_renderer, callback, Input, Output
from dash_iconify import DashIconify
_dash_renderer._set_react_version("18.2.0")
def get_icon(icon):
return DashIconify(icon=icon, height=16)
app = Dash(external_stylesheets=dmc.styles.ALL)
app.layout = dmc.MantineProvider(
dmc.NavLink(
id="link",
label="Toggle active",
leftSection=get_icon(icon="bi:house-door-fill"),
n_clicks=0,
w=200
),
)
@callback(
Output("link", "active"),
Input("link", "n_clicks"),
)
def notify(n):
if n % 2 == 0:
return True
return False
if __name__ == "__main__":
app.run_server(debug=True)
I have a basic usage here:
However, it seems that the callback is never trigerred, even with print statements in the callback.