8000 [docs] fix scroll into view for sidebar by cmpadden · Pull Request #28030 · dagster-io/dagster · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[docs] fix scroll into view for sidebar #28030

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

Merged
merged 6 commits into from
Mar 20, 2025
Merged

Conversation

cmpadden
Copy link
Contributor
@cmpadden cmpadden commented Feb 24, 2025

Summary & Motivation

Closes DOC-888.

Introduces plugin to automatically scrollIntoView()the active left sidebar item.

plugins: [
  require.resolve('./src/plugins/sidebar-scroll-into-view'),
],

This is a temporary workaround until it is re-introduced upstream (pending since 2022): see source code.

How I Tested These Changes

Confirmed working as expected on localhost.

Changelog

  • [docs] automatically scroll left sidebar into view on direct link to documentation

@cmpadden cmpadden closed this Feb 24, 2025
@cmpadden cmpadden reopened this Mar 20, 2025
@cmpadden cmpadden marked this pull request as ready for review March 20, 2025 17:02
@cmpadden cmpadden requested a review from neverett as a code owner March 20, 2025 17:02
@cmpadden cmpadden requested review from salazarm and hellendag March 20, 2025 17:02
@salazarm
Copy link
Contributor

Does this handle scrolling when you switch pages? If not we still need to hook into that

@cmpadden
Copy link
Contributor Author

Does this handle scrolling when you switch pages? If not we still need to hook into that

Good call! Thought I'd be able to remove these, but re-introduced:

  window.addEventListener('popstate', () => handleScrollIntoView());
  window.addEventListener('pushstate', () => handleScrollIntoView());

And confirmed it's working as expected. Thanks @salazarm .

Copy link
github-actions bot commented Mar 20, 2025

Deploy preview for dagster-docs ready!

Preview available at https://dagster-docs-8zxxk8y6i-elementl.vercel.app
https://colton-fix-scroll-into-view.archive.dagster-docs.io

Direct link to changed pages:

@cmpadden cmpadden merged commit ae3ca11 into master Mar 20, 2025
6 of 7 checks passed
@cmpadden cmpadden deleted the colton/fix-scroll-into-view branch March 20, 2025 17:57
prha pushed a commit that referenced this pull request Mar 21, 2025
## Summary & Motivation

Closes DOC-888.

Introduces plugin to automatically `scrollIntoView()`the active left
sidebar item.

```
plugins: [
  require.resolve('./src/plugins/sidebar-scroll-into-view'),
],
``` 

This is a temporary workaround until it is re-introduced upstream
(pending since 2022): [see source
code](https://github.com/facebook/docusaurus/blob/f31bfec3c9a7e9e032a36ccd9b405b0e2c2f6957/packages/docusaurus-theme-common/src/hooks/useTOCHighlight.ts#L158).

* facebook/docusaurus#6748
* facebook/docusaurus#6319
* facebook/docusaurus#7980

## How I Tested These Changes

Confirmed working as expected on localhost.

## Changelog

- [docs] automatically scroll left sidebar into view on direct link to
documentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0