Skip to content

A URL hash that is not a page name blanks a multi-page dashboard #14818

Description

@cwickham

I have:

  • searched the issue tracker for similar issues
  • installed the latest version of Quarto CLI
  • formatted my issue following the Bug Reports guide

Bug description

In a dashboard with more than one page, a URL hash that does not name a page hides every page. The content area becomes empty. The navbar stays visible.

Hashes that do not name a page are common. Examples are footnote links, cross-references, and hand-written in-page anchors.

showPage() removes the active class from every nav tab and every .tab-pane. It then adds active back only to the pane whose id matches the hash (quarto-dashboard.js#L242-L266). When no pane matches, no pane is active, so the dashboard shows nothing.

Two places pass the hash to showPage() without a test:

  • the hash processing on load (#L109-L117)
  • the popstate handler, which runs on every hash change (#L120-L123)

QuartoDashboardUtils.isPage() already does this test (#L229-L232), but neither place calls it.

This is the general form of #9411, which #11264 closed. That fix stopped external links from reaching showPage(). It did not change the load path or the popstate path, so in-page anchors still blank the dashboard.

One related problem affects any fix: isPage() builds a CSS selector by string concatenation. It throws a SyntaxError for a hash that is not a valid selector, such as #, #1foo, or #a:b. On load, the code that removes the hidden class runs after this point. A guard that calls isPage() must therefore not throw, or the whole dashboard stays invisible.

Steps to reproduce

---
title: "Two page dashboard"
format: dashboard
---

# Heat

## Row

Content A

# Cool

## Row

Content B
  1. Render the document.
  2. Open the HTML output in a browser.
  3. Add #no-such-thing to the end of the URL, then load the page.

Actual behavior

The content area is empty. Both panes lose the active class, and no navbar tab is active. The navbar still shows both page names.

A reload of the same URL shows the same empty state.

Expected behavior

The dashboard keeps the current page. If the anchor exists in the page, the browser scrolls to it.

Your environment

  • Positron 1.124.0
  • macOS 26.5.2 (build 25F84)

Quarto check output

Quarto 1.10.18
[✓] Checking environment information...
      Quarto cache location: /Users/charlottewickham/Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.10.0: OK
      Dart Sass version 1.101.0: OK
      Deno version 2.7.14: OK
      Typst version 0.15.1: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.10.18
      Path: /Applications/quarto/bin
[✓] Checking tools....................OK
      TinyTeX: v2026.04
      Chrome Headless Shell: 150.0.7871.115
      VeraPDF: 1.28.2
[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /Users/charlottewickham/Library/TinyTeX/bin/universal-darwin
      Version: 2026
[✓] Checking Chrome Headless....................OK
      Using: Chrome Headless Shell installed by Quarto
      Path: /Users/charlottewickham/Library/Application Support/quarto/chrome-headless-shell/chrome-headless-shell-mac-arm64/chrome-headless-shell
      Version: 150.0.7871.115
[✓] Checking basic markdown render....OK
[✓] Checking R installation...........OK
      Version: 4.5.2
      Path: /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources
      LibPaths:
        - /Users/charlottewickham/Library/R/arm64/4.5/library
        - /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/library
      knitr: 1.51
      rmarkdown: 2.30
[✓] Checking Knitr engine render......OK
[✓] Checking Python 3 installation....OK
      Version: 3.12.2
      Path: /Users/charlottewickham/.pyenv/versions/3.12.2/bin/python3
      Jupyter: 5.9.1
      Kernels: python3
[✓] Checking Jupyter engine render....OK
[✓] Checking Julia installation...

Investigation was AI-assisted, grounded in a local clone (per CONTRIBUTING.md).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions