Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Callback run twice when should only once #8

Unanswered
Hootie9lives asked this question in Q&A
Discussion options

Hi @Coding-with-Adam,

I am curious if there is any insights you can share with me on this issue I'm having.

@app.callback(
 Output({'type': 'jira_modal', 'index': MATCH}, "is_open"),
 Output({'type': 'modal_form', 'index': MATCH}, "children"),
 Output({'type': 'modal_form', 'index': MATCH}, "style"),
 Output({'type': 'id', 'index': MATCH}, 'data'),
 Input({'type': 'decision', 'index': MATCH}, 'value'),
 Input("modal_submit", "n_clicks"),
 State({'type': 'name', 'index': MATCH}, 'value'),
 State({'type': 'country', 'index': MATCH}, 'value'),
 State({'type': 'jira_modal', 'index': MATCH}, "is_open"),
 State("session", "data"),
 State("user_id", "data"), prevent_initial_call=True)

I have a callback like this. Whenever I click on modal_submit button to change the Is_open state of the modal, the callback is ran twice.

You must be logged in to vote

Replies: 1 comment

Comment options

Sorry, it's hard to say why without seeing the whole code, @Hootie9lives
I'm not sure what's happening there.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /