Skip to content

Scroll to top with page transition #32

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 2 commits into from
Jul 18, 2023
Merged

Conversation

kyntk
Copy link
Contributor

@kyntk kyntk commented Jul 18, 2023

What

  • ページ遷移の際にトップにスクロールするようにした
  • 使われていないstate, 関数等を削除した

How

  • 現在はサイドバーとコンテンツの高さを固定せず、スクロール可能にした上で、React Router DomのScrollRestorationを使った

Why

Refs

2023-07-18.17.52.47.mov

@kyntk kyntk force-pushed the scroll-to-top-with-page-transition branch from 767a164 to ea854e1 Compare July 18, 2023 08:43

...viewport.S({
gridTemplateColumns: "auto 1fr",
gridTemplateColumns: "auto minmax(0, 1fr)", // Setting min width to prevent widening
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kyntk kyntk requested review from a team, getty104 and DeguchiHiroki and removed request for a team July 18, 2023 08:50
@getty104 getty104 assigned kyntk and getty104 and unassigned getty104 Jul 18, 2023
Copy link
Member

@getty104 getty104 left a comment

Choose a reason for hiding this comment

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

LGTM!

return (
<div>
<Outlet />
<ScrollRestoration />
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

@DeguchiHiroki DeguchiHiroki left a comment

Choose a reason for hiding this comment

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

LGTM!

@kyntk kyntk merged commit 42f74f0 into main Jul 18, 2023
@kyntk kyntk deleted the scroll-to-top-with-page-transition branch July 18, 2023 10:48
@ohakutsu ohakutsu mentioned this pull request Jul 19, 2023
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