Skip to content

instant loading breaks announcement bar dismissal #5901

@thesuperzapper

Description

@thesuperzapper

Context

Probably related to #3615

Bug description

Currently, if someone enables navigation.instant and announce.dismiss at the same time, the announcement will only stay dismissed until the next page navigation, after which it will reappear again.

The cause is fairly straightforward, it is simply that [data-md-component=announce] should not be selected in the instant reload typescript:

When I removed this line in a custom theme, everything worked as expected (with the announcement staying dismissed).

Related links

Reproduction

.

Steps to reproduce

  1. Create a MkDocs material website with navigation.instant and announce.dismiss enabled
  2. Override the main.html template's {% block announce %} to have some content
  3. Load the website, and dismiss the announcement bar
  4. Navigate to a new page on the website (without reloading)
  5. The announcement bar will reappear

Browser

No response

Before submitting

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue reports a bugresolvedIssue is resolved, yet unreleased if open

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions