Hello! I am trying to pause live updates (with dcc.interval) when my off canvas is open. I would like the interval to be enabled when the canvas is closed/clicked out of. Here is the callback I have so far:
##toggle timeline config offcanvas
@app.callback(
Output(component_id="offcanvas-timeline", component_property="is_open"),
Output(component_id='interval-component',component_property= 'disabled'),
Output(component_id='open-offcanvas-timeline',component_property= 'n_clicks'),
Input(component_id="open-offcanvas-timeline", component_property="n_clicks"),
State(component_id="offcanvas-timeline", component_property="is_open"),
)
def toggle_offcanvas_scrollable_timeline(n1, is_open):
if n1 == 1:
return True, True, None
return False, False, None
On page load, the dcc.interval is working and it does pause when I open the canvas. However, it does not restart after I close the canvas. I am trying to reset the number of clicks, but something is off.