Skip to content

Wrong tab indicate as active in navbar #11481

Open

Description

@ecomodeller

Bug description

Top navigation adds an .active class to the current page. This feature is broken in some cases, e.g. when a sidebar is used in addition to a top navbar.

This was previously discussed in #1321

Steps to reproduce

Example of problematic quarto project
Image

Contents of _quarto.yml:

project:
  type: website

website:
  title: "Navigation tabs"
  search: true
  sidebar:
    style: docked
    contents:
      - href: index.qmd
        text: Home
      - href: getting_started.qmd
  navbar:
    left:
      - href: index.qmd
        text: Home
      - href: getting_started.qmd
        text: "Getting Started"
      - about.qmd

format:
  html:
    theme: journal
    css: styles.css
    toc: true

Expected behavior

The current page should be indicated as active in the navbar.

If there is no link in the navbar, no link should be marked as active.

Actual behavior

The wrong link is marked as active.

Your environment

  • IDE: VSCode
  • OS: Linux Ubuntu 24.04

Quarto check output

quarto check

Quarto 1.5.55
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.2.0: OK
Dart Sass version 1.70.0: OK
Deno version 1.41.0: OK
Typst version 0.11.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.5.55
Path: /opt/quarto/bin

[✓] Checking tools....................OK
TinyTeX: v2024.11
Chromium: (not installed)

[✓] Checking LaTeX....................OK
Using: TinyTex
Path: /home/jan/.TinyTeX/bin/x86_64-linux
Version: 2024

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
Version: 3.12.7
Path: /home/jan/.local/bin/python3
Jupyter: 5.7.2
Kernels: julia-1.10, julia-nodeps-1.10, python3

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK
Version: 4.1.2
Path: /usr/lib/R
LibPaths:
- /home/jan/R/x86_64-pc-linux-gnu-library/4.1
- /usr/local/lib/R/site-library
- /usr/lib/R/site-library
- /usr/lib/R/library
knitr: 1.45
rmarkdown: 2.25

[✓] Checking Knitr engine render......OK

Activity

  1. added
    bug
    on Nov 19, 2024
  2. mcanouil commented on Nov 19, 2024

    @mcanouil
    Collaborator

    Could you share a Git repository rather than a ZIP archive?

  3. added
    websites
    on Nov 19, 2024
  4. ecomodeller commented on Nov 19, 2024

    @ecomodeller
    Author

    Could you share a Git repository rather than a ZIP archive?

    Git repository
    Rendered site

  5. mcanouil commented on Nov 19, 2024

    @mcanouil
    Collaborator
  6. jmlord commented on Jun 18, 2025

    @jmlord

    This bug is reproducible even with a virtually empty sidebar, containing only a logo:

      sidebar:
        style: floating
        logo: /myLogo.png
    
  7. added this to the Future milestone on Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugwebsite-navigationwebsites

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions