plotly / plotly/dash

prevent_initial_callback appears to have no effect on page load for multi-page apps

Open
#1,513 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P3
Dominant language
Python
Stars
24.4k
Forks
2.3k
Avg merge
2d 7h
Merged PRs (30d)
13

Description

Currently using dash 1.18.1, trying to use prevent_initial_callback=True. For multi-page apps, I do not want certain callbacks to trigger when loading a specific page. However, prevent_initial_callback appears to have no effect. Each page is considered as an external link. Should I just check if n_clicks = None?

Don't think it matters but I have a flat structure shown in the dash tutorials

  • app.py
  • layouts.py
  • callbacks.py
  • index.py

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported behavior in the flat app structure: app.py, layouts.py, callbacks.py, and index.py, using Dash 1.18.1 and multi-page navigation. Confirm whether prevent_initial_callback is ignored on page load, then define the expected callback behavior and capture it in a minimal regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.