Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Patch += operation not working on the patch object. #2855

Closed
T4rk1n opened this issue May 9, 2024 · 0 comments · Fixed by #2859
Closed

[BUG] Patch += operation not working on the patch object. #2855

T4rk1n opened this issue May 9, 2024 · 0 comments · Fixed by #2859

Comments

@T4rk1n
Copy link
Contributor

T4rk1n commented May 9, 2024

If you have a patch object for a number prop and try to do patched += 1, the callback will fail with an error, returned non serializable object.

Example:

app = Dash()
app.layout = [dcc.Store(data=0, store="store"), html.Button("click", id="click")]
@app.callback(Output("store", "data"), Input("click", "n_clicks"))
def on_click(_):
    patched = Patch()
    patched += 1
    return patched

Clicking on the button result in the error, it should instead update the store data prop to +1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant