Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search does not restore hidden header when using header.autohide #2233

Closed
5 tasks done
Mario-Hofstaetter opened this issue Jan 23, 2021 · 3 comments
Closed
5 tasks done
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@Mario-Hofstaetter
Copy link

Mario-Hofstaetter commented Jan 23, 2021

I've found a bug and checked that ...

  • ... the problem doesn't occur with the default MkDocs template
  • ... the documentation does not mention anything about my problem
    • Only mentions the feature is still 'experimental'
  • ... the problem is not in any of my customizations (CSS, JS, template)
  • ... there are no open or closed issues that are related to my problem
    • Searched for autohide

Description

When using header.autohide , the header is hidden after scrolling down a bit.

However, if Search is invoked by keyboard shortcut keys [F] or [S], the header will not reappear and the search bar will be cut off at the top, showing the search results but not the input box.

Sometimes / at some point the header and search box will re-appear.

Please see this gif:

mr7lYqPaJy

Expected behavior

When invoking search, the auto-hidden header should be displayed again.

Actual behavior

Header is not always displayed when starting searching.

Steps to reproduce the bug

  1. Use - header.autohide
  2. Open long page and scroll down until header is auto hidden
  3. Hit S to trigger search bar and type something, header is not displayed

Package versions

  • Docker Image: squidfunk/mkdocs-material:6.2.5

  • Python: Python 3.8.1

  • MkDocs: mkdocs, version 1.1.2 from /usr/local/lib/python3.8/site-packages/mkdocs (Python 3.8)

  • Material: Version: 6.2.5

Project configuration

Truncated config used when creating the gif shown above:

nav:
  - Übersicht: 
    - Startseite:               index.md
    - Exporter:
      - node_exporter (Linux):  Prometheus/Exporters/node_exporter.md
site_dir: /site
site_name: Monitoring Docs
theme:
  features:
    - header.autohide
    - navigation.tabs
  name: material

System information

  • OS: Windows 10 Version 20H2 Build 19042.746
  • Browser: Firefox 84.0.2
@Mario-Hofstaetter Mario-Hofstaetter changed the title Search is not fully visible when using header.autohide Search does not restore hidden header when using header.autohide Jan 23, 2021
@squidfunk
Copy link
Owner

squidfunk commented Jan 23, 2021

Thanks for reporting and providing the screen recording! That's indeed unintended, the header should show up.

@squidfunk squidfunk added the bug Issue reports a bug label Jan 23, 2021
@squidfunk
Copy link
Owner

Fixed in be1f9c1. I refactored the autohiding logic, which as you discovered is still experimental. This means that there might be other edge cases to consider, so the implementation might still not be complete. Nonetheless, header + search now behave as follows:

Ohne.Titel.mp4

It's still not perfect in a way that the page sometimes jumps when focusing the search on the hidden header, but that would need some serious refactoring, as we'd have to delay the focus event until the header is visible. I will consider this for some later refactoring, but for now, I think this should work well enough.

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Jan 24, 2021
@squidfunk
Copy link
Owner

Released as part of 6.2.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

2 participants