Persistence in Dash not updated when server callback updates field

Hi all,

I have a multipage app where I’d like to use persistance=True to save the fields between tabs.

One of these fields is updated by a server callback, but when inspecting the localStorage the value isn’t set in the store. The field really should be persisted, as the server callback is to import data. The user shouldn’t need to reimport when changing tabs back

Minimal reproductive example:

from random import randint
from dash import Dash
from dash.exceptions import PreventUpdate
from dash.dependencies import Output, Input
import dash_html_components as html
import dash_core_components as dcc

app = Dash(
)  # type: Dash

app.layout = html.Div(
        html.Button("Click me", id="btn"),

    Output("field", "value"),
    Input("btn", "n_clicks"),
def update(n):
    if n is None or n == 0:
        raise PreventUpdate

    return str(randint(0, 100))

app.run_server(debug=True, host="", port=8050)

Looks like there’s an issue for this here: [BUG] Dropdown: programatically set value isn't persisted · Issue #1252 · plotly/dash · GitHub