I’ve used Dash and persistence=True for about five years. However with a new simple program it doesn’t seem to be working properly with dcc.RadioItems. On every page reload, the value switches back to the original value=‘value’ setting, in this case ‘A’.
Please let me know if I need to make a change or have a misunderstanding on persistence across page refreshes.
from dash import Dash, html, dcc, callback, Output, Input
app = Dash()
app.layout = [
html.Div(className='row', children=[
dcc.RadioItems(id='radio_abc',
options=['A', 'B', 'C'],
value='A',
inline=True,
persistence=True,
persistence_type='local')
], style={'display': 'inline-block'}),
html.Div(id='div_abc')
]
@callback(
Output(component_id='div_abc', component_property='children'),
Input(component_id='radio_abc', component_property='value'),
)
def update_graph(abc):
return abc
# Run the app
if __name__ == '__main__':
app.run()