-
Notifications
You must be signed in to change notification settings - Fork 379
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
docs: Don't hide the version selector when scrolling down #5114
base: main
Are you sure you want to change the base?
Conversation
How do I test this? I can't get the version selector to appear locally (with or without this change). |
Honestly idk I just set up an override for Screen.Recording.2024-12-17.at.00.45.30.mp4 |
@@ -0,0 +1,22 @@ | |||
document$.subscribe(function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: I tried this out and it seems to not work when I reload the page and keep the same scroll location. The header doesn't disappear until I scroll up and scroll down again.
However, removing the document$.subscribe
and calling the function immediately seems to resolve the issue. My guess is that if the page is already scrolled down, then we never observe a mutation in the header for whatever reason. It looks like extra.js
is embedded in the page after the target header element, so there should be a guarantee that the element can be addressed and we can install the mutation observer safely?
nit: Should this function
also be an arrow function instead, like the other ones in this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok thanks, I’ll try without subscribe then
by popular request (@arxanas)
NB: this also means the header will always say "Jujutsu docs", but maybe it's good because the user will be reminded that they are in the presence of mighty Jujutsu and will behave accordingly
Checklist
If applicable:
CHANGELOG.md