Quantcast
Channel: 🎛️ Dash - Plotly Community Forum
Viewing all articles
Browse latest Browse all 6271

Dash Bootstrap Components Navbar not triggering URL Callback

$
0
0

Hi There,

I’m stuck with a problem and no idea how to debug it. I have a SimpleNavBar from Dash Bootstrap Components and it used to work (actually the same code on a different PC works!)

So what the navbar should do when clicking on an item is triggering the callback below. However, it just updates the URL in the address bar of Chrome and does nothing else. Then, when I hit F5, it triggeres the Callback.

At least that is what I see when setting a breakpoint there.

Any Idea what’s wrong or what could prevent chrome from reloading the page properly?

Also, interestingly, the Spinners (dbc.Spinner) stopped working as well. The spin and spin without end. When I revove a Spinner from a Graph, it shows the graph just fine.

Maybe uses the same mechanism? But what could be wrong?

def callback_url(app):
    @app.callback(Output('page-content', 'children'),
                  [Input('url', 'pathname')])
    def display_page(pathname):
        # HPLC specific
        if pathname == '/HPLC/worldmap':
            return layouts.layout_worldmap("HPLC")
        elif pathname == '/HPLC/sales_history':
            return layouts.layout_sales_hist_wo_cuv("HPLC")
        elif pathname == '/HPLC/hemoglobinopathies':
            return layouts.layout_hemoglobinopathies_worldmap()
        # coag specific
        elif pathname == '/coag/worldmap':
            return layouts.layout_worldmap("Hemostasis")
        elif pathname == '/coag/market_estimation':
            return layouts.layout_coag_market_est()
        elif pathname == '/coag/sales_history':
            return layouts.layout_sales_hist_w_cuv("Hemostasis")
        #
        else:
            return layouts.layout_nopage()

2 posts - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 6271

Trending Articles