Skip to content

fix(router): Do not reset scroll on url hash changes#9004

Merged
dac09 merged 5 commits intoredwoodjs:mainfrom
dac09:fix/router-scroll-reset
Aug 9, 2023
Merged

fix(router): Do not reset scroll on url hash changes#9004
dac09 merged 5 commits intoredwoodjs:mainfrom
dac09:fix/router-scroll-reset

Conversation

@dac09
Copy link
Contributor

@dac09 dac09 commented Aug 3, 2023

Pairing with @KrisCoulson

Found this issue that's worth a discussion before merge. Here's an explanation and demo of the issue+solution: https://s.tape.sh/xkIAUjTi?s=1.25

To resolve before merging:

  • Should modifying query params reset the scroll state?
    Decision from CTM: yes.
  • Do we need to reset scroll state on first render? Or just when doing client side navigation between pages
    I've removed this now - we only reset scroll state on client side navigation. Hard renders are handled by the browser anyway.

@dac09 dac09 added the release:fix This PR is a fix label Aug 3, 2023
@dac09 dac09 added this to the next-release-patch milestone Aug 3, 2023
@KrisCoulson
Copy link
Contributor

After discussion in todays meeting query string params should scroll the page to top.

dac09 added 2 commits August 9, 2023 14:20
…croll-reset

* 'main' of github.com:redwoodjs/redwood:
  fix(deps): update dependency pino to v8.15.0 (redwoodjs#9023)
  fix(deps): update dependency eslint to v8.46.0 (redwoodjs#9022)
  fix(deps): update dependency react-hook-form to v7.45.4 (redwoodjs#9017)
  chore(docs): reversion docs to include recent changes
  fix(deps): update dependency vite to v4.4.9 (redwoodjs#9018)
  v6.0.4
  fix(docs): update quick start to fix Storybook start up (redwoodjs#9014)
  cherry pick part of "fix: Improve GraphQL Schema Validation to allow Subscription types when not using Realtime and ensure schema does not use reserved names (redwoodjs#9005)"
  fix: Improve GraphQL Schema Validation to allow Subscription types when not using Realtime and ensure schema does not use reserved names (redwoodjs#9005)
  Docs: Explain the entry.client.{jsx,tsx} file (redwoodjs#8987)
  chore(deps): update dependency esbuild to v0.18.19 (redwoodjs#8983)
  chore(deps): update dependency nx-cloud to v16.2.0 (redwoodjs#8985)
  docs(fonts): Update @font-face recommendation (redwoodjs#8986)
  Docs: remove useless code in code snippet (redwoodjs#8990)
  v6.0.3
  fix(router): Prevent rerendering authenticated routes on hash change (redwoodjs#9007)
  Remove the indexed type reference on AvailableRoutes (redwoodjs#8918)
@dac09 dac09 enabled auto-merge (squash) August 9, 2023 07:23
@dac09 dac09 changed the title fix(router): Do not reset scroll on query & hash changes fix(router): Do not reset scroll on url hash changes Aug 9, 2023
@dac09 dac09 merged commit 8dc8e80 into redwoodjs:main Aug 9, 2023
dac09 added a commit to dac09/redwood that referenced this pull request Aug 9, 2023
…sr-stream

* 'main' of github.com:redwoodjs/redwood:
  feat(streaming-ssr): Fix build and server html injection (redwoodjs#8978)
  fix(router): Do not reset scroll on query & hash changes (redwoodjs#9004)
  fix(deps): update dependency pino to v8.15.0 (redwoodjs#9023)
  fix(deps): update dependency eslint to v8.46.0 (redwoodjs#9022)
  fix(deps): update dependency react-hook-form to v7.45.4 (redwoodjs#9017)
  chore(docs): reversion docs to include recent changes
  fix(deps): update dependency vite to v4.4.9 (redwoodjs#9018)
  v6.0.4
  fix(docs): update quick start to fix Storybook start up (redwoodjs#9014)
  cherry pick part of "fix: Improve GraphQL Schema Validation to allow Subscription types when not using Realtime and ensure schema does not use reserved names (redwoodjs#9005)"
  fix: Improve GraphQL Schema Validation to allow Subscription types when not using Realtime and ensure schema does not use reserved names (redwoodjs#9005)
  Docs: Explain the entry.client.{jsx,tsx} file (redwoodjs#8987)
  chore(deps): update dependency esbuild to v0.18.19 (redwoodjs#8983)
  chore(deps): update dependency nx-cloud to v16.2.0 (redwoodjs#8985)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:fix This PR is a fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants