remix-run / remix

Build Better Websites. Create modern, resilient user experiences with web fundamentals.
https://remix.run
MIT License
28.15k stars 2.36k forks source link

Scrolls the page down only if the current scroll position is 0 #9436

Closed devoren closed 2 weeks ago

devoren commented 2 weeks ago

Reproduction

NA

System Info

System:
    OS: macOS 14.4.1
    CPU: (8) arm64 Apple M1
    Memory: 76.11 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.12.2 - /usr/local/bin/node
    npm: 10.5.0 - /usr/local/bin/npm
    bun: 1.1.4 - /usr/local/bin/bun
  Browsers:
    Chrome: 124.0.6367.207
    Safari: 17.4.1
  npmPackages:
    @remix-run/css-bundle: ^1.19.3 => 1.19.3 
    @remix-run/dev: ^1.19.3 => 1.19.3 
    @remix-run/eslint-config: ^1.19.3 => 1.19.3 
    @remix-run/express: ^1.19.3 => 1.19.3 
    @remix-run/node: ^1.18.1 => 1.19.3 
    @remix-run/react: ^1.19.3 => 1.19.3

Used Package Manager

npm

Expected Behavior

When the page is reloaded, it should not scroll to the end of the page if the scroll position is 0.

Actual Behavior

When I reload the page, it scrolls to the bottom of the page only if my current scroll position is 0. But if I scroll a few pixels and reload, everything works as expected. I can't share the reproduction at the moment :c

remix.config.js

/** @type {import('@remix-run/dev').AppConfig} */
export default {
  ignoredRouteFiles: ['**/.*'],
  serverDependenciesToBundle: [
    'remix-i18next',
    'axios',
    'react-use',
    'nanoid',
  ],
  future: {
    v2_dev: true,
    v2_routeConvention: true,
    v2_meta: true,
    v2_errorBoundary: true,
    v2_normalizeFormMethod: true,
    v2_headers: true,
  },
  serverModuleFormat: 'esm',
  tailwind: true,
}