plotly / plotly/dash

html.Br("") behaves incorrectly in multi-page app

Open
#2,390 2 comments 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

Describe your context
Please provide us your environment, so we can easily reproduce the issue.

  • replace the result of pip list | grep dash below
dash                      2.7.0
dash-bootstrap-components 1.2.1
dash-bootstrap-templates  1.0.7
dash-core-components      2.0.0
dash-daq                  0.5.0
dash-html-components      2.0.0
dash-table                5.0.0
mongo-dash                0.1.6

  • if frontend related, tell us your Browser, Version and OS

    • OS: Monterey 12.4

Describe the bug

Replication example:

import dash
import dash_bootstrap_components as dbc
from dash import html

dash.register_page(__name__, name='Example', top_nav=True)

layout = dbc.Container(children=[
                                    html.Br("")
                                ])

In a multi-page app, I had accidentally put an empty string in a html.Br() element within the layout for a page. Whenever navigating to the page it would partially load for a second and then navigate back to the previous page I was on. I could however access the correct page by entering the url for the page in the browser.

Expected behavior

There should be some error message in debug that a redirection is happening and what is causing it.

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 with the supplied Dash multi-page reproduction using html.Br("") and observe navigation in debug mode. The payload names no source file or test; trace how the empty child is handled during page navigation, with completion indicated by a useful error explaining the redirect cause instead of the page silently returning to the previous route.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.