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

fix(docs): ref scroll #29819

Merged
merged 1 commit into from
Oct 11, 2024
Merged

fix(docs): ref scroll #29819

merged 1 commit into from
Oct 11, 2024

Conversation

charislam
Copy link
Contributor

@charislam charislam commented Oct 10, 2024

Fix various scrolling bugs with reference pages:

  • Take out smooth scrolling as it tends to lead to buggy scrolling position
  • Add overscroll-behavior: contain to the nav, otherwise overscrolling on the nav scrolls the main page, which causes the nav to jump around unexpectedly
  • Put aria-current calculation in useEffect as otherwise it doesn't trigger properly on first load

See https://supabase.slack.com/archives/C023E4L60R3/p1728116359237709

Copy link

supabase bot commented Oct 10, 2024

No changes detected in supabase directory.
This pull request has been ignored for the connected project xguihxuzqibwxjnimxev due to its connection settings.
Go to Project Integrations Settings ↗︎ in order to change this behavior.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

Copy link

vercel bot commented Oct 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 11, 2024 3:29pm
5 Skipped Deployments
Name Status Preview Comments Updated (UTC)
design-system ⬜️ Ignored (Inspect) Visit Preview Oct 11, 2024 3:29pm
studio ⬜️ Ignored (Inspect) Visit Preview Oct 11, 2024 3:29pm
studio-self-hosted ⬜️ Ignored (Inspect) Visit Preview Oct 11, 2024 3:29pm
studio-staging ⬜️ Skipped (Inspect) Oct 11, 2024 3:29pm
zone-www-dot-com ⬜️ Skipped (Inspect) Oct 11, 2024 3:29pm

Fix various scrolling bugs with reference pages:

- Take out smooth scrolling as it tends to lead to buggy scrolling position
- Add overscroll-behavior: contain to the nav, otherwise overscrolling on the nav scrolls the main page, which causes the nav to jump around unexpectedly
- Put aria-current calculation in useEffect as otherwise it doesn't trigger properly on first load
@vercel vercel bot temporarily deployed to Preview – studio-staging October 10, 2024 17:29 Inactive
@vercel vercel bot temporarily deployed to Preview – zone-www-dot-com October 10, 2024 17:29 Inactive
@vercel vercel bot temporarily deployed to Preview – zone-www-dot-com October 10, 2024 17:30 Inactive
@vercel vercel bot temporarily deployed to Preview – studio-staging October 10, 2024 17:30 Inactive
@vercel vercel bot temporarily deployed to Preview – studio-staging October 10, 2024 17:41 Inactive
@vercel vercel bot temporarily deployed to Preview – zone-www-dot-com October 10, 2024 17:41 Inactive
@vercel vercel bot temporarily deployed to Preview – studio-staging October 10, 2024 17:48 Inactive
@vercel vercel bot temporarily deployed to Preview – zone-www-dot-com October 10, 2024 17:48 Inactive
@vercel vercel bot temporarily deployed to Preview – zone-www-dot-com October 10, 2024 18:45 Inactive
@vercel vercel bot temporarily deployed to Preview – studio-staging October 10, 2024 18:45 Inactive
Copy link
Member

@avallete avallete left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

const scrollPosition = offsetTop - parentOffsetTop

parentRef.current?.scrollTo({
top: scrollPosition - 60 /* arbitrary padding */,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question

If that's meant to offset the scrolling, doesn't that match the "top navbar" height (50px) a bit of padding ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep that's true, will update comment 👍🏼

@vercel vercel bot temporarily deployed to Preview – studio-staging October 11, 2024 15:25 Inactive
@vercel vercel bot temporarily deployed to Preview – zone-www-dot-com October 11, 2024 15:25 Inactive
@charislam charislam enabled auto-merge (squash) October 11, 2024 15:47
@charislam charislam merged commit 1236406 into master Oct 11, 2024
13 checks passed
@charislam charislam deleted the fix/ref-nav-scroll branch October 11, 2024 15:51
Crispy1975 pushed a commit that referenced this pull request Oct 16, 2024
Fix various scrolling bugs with reference pages:

- Take out smooth scrolling as it tends to lead to buggy scrolling position
- Add overscroll-behavior: contain to the nav, otherwise overscrolling on the nav scrolls the main page, which causes the nav to jump around unexpectedly
- Put aria-current calculation in useEffect as otherwise it doesn't trigger properly on first load
encima pushed a commit that referenced this pull request Nov 19, 2024
Fix various scrolling bugs with reference pages:

- Take out smooth scrolling as it tends to lead to buggy scrolling position
- Add overscroll-behavior: contain to the nav, otherwise overscrolling on the nav scrolls the main page, which causes the nav to jump around unexpectedly
- Put aria-current calculation in useEffect as otherwise it doesn't trigger properly on first load
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.

3 participants