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

Sticky header covers scroll targets #401

Open
mootari opened this issue Apr 7, 2022 · 7 comments
Open

Sticky header covers scroll targets #401

mootari opened this issue Apr 7, 2022 · 7 comments
Labels
Bug Something isn't working Notebook

Comments

@mootari
Copy link
Member

mootari commented Apr 7, 2022

Describe the bug

When a notebook contains edits, Observable sticks the notebook menu bar to to the top of the viewport.

This bar covers jump targets (anchors, search results) and thus several impedes navigation and orientation within a notebook.

Expected behavior

Scrolling to elements is offset by the height of the sticky bar.

Additional context

This is an longstanding problem that has likely been touched on in other issues as well.

@mootari
Copy link
Member Author

mootari commented Apr 7, 2022

Workaround

Add a user style sheet with the following content:

@-moz-document url-prefix("https://observablehq.com/") {
  #__next div[data-node-id], .cm-content > div {
    scroll-margin-top: 52px;
    scroll-margin-bottom: 52px;
  }
}

This also fixes the scrolling issue described in #291 (comment).

Edit: Does not work for jumps from cell references to viewof cells.

@mootari mootari changed the title Sticky header covers jump targets Sticky header covers scroll targets Apr 7, 2022
@CobusT
Copy link
Collaborator

CobusT commented Apr 18, 2022

@mootari Could you attach an example video of this problem. I can't seem to reproduce it (see video clip)

Screen.Recording.2022-04-18.at.11.21.19.AM.mov

.

@mbostock
Copy link
Member

Cobus, we fixed this recently.

@CobusT CobusT added Bug Something isn't working Notebook labels Apr 18, 2022
@mootari
Copy link
Member Author

mootari commented Apr 19, 2022

@CobusT It's fixed for search results, but still a problem for anchors:

  1. Go to https://observablehq.com/@ambassadors/input-history@2582
  2. In the first cell output, look for the line that says "Go to: inputHistory, statesWidget, Changelog, Todos"
  3. Click either "inputHistory" or "statesWidget"

@mootari
Copy link
Member Author

mootari commented Sep 6, 2022

This is still an issue for anchors.

@CobusT
Copy link
Collaborator

CobusT commented Oct 25, 2023

I think this has been fixed by the new implementation of the sticky headers. Please re-open if this is not the case. I cannot reproduce.

@CobusT CobusT closed this as completed Oct 25, 2023
@mootari
Copy link
Member Author

mootari commented Oct 26, 2023

Sticky headers still cover the target:

image

@mootari mootari reopened this Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Notebook
Projects
None yet
Development

No branches or pull requests

3 participants