├── .github └── workflows │ └── release.yml ├── .gitignore ├── README.md ├── package-lock.json ├── package.json ├── src └── index.tsx └── tsconfig.json /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: release 2 | on: [push, pull_request] 3 | 4 | concurrency: 5 | group: ${{ github.workflow }}-${{ github.ref }} 6 | cancel-in-progress: true 7 | 8 | permissions: 9 | contents: write # to be able to publish a GitHub release 10 | id-token: write # to enable use of OIDC for npm provenance 11 | issues: write # to be able to comment on released issues 12 | pull-requests: write # to be able to comment on released pull requests 13 | 14 | jobs: 15 | release: 16 | name: 🚀 Release 17 | runs-on: ubuntu-latest 18 | if: 19 | ${{ github.repository == 'epicweb-dev/restore-scroll' && 20 | contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/alpha', 21 | github.ref) && github.event_name == 'push' }} 22 | steps: 23 | - name: ⬇️ Checkout repo 24 | uses: actions/checkout@v4 25 | 26 | - name: ⎔ Setup node 27 | uses: actions/setup-node@v4 28 | with: 29 | node-version: 20 30 | 31 | - name: 📥 Download deps 32 | uses: bahmutov/npm-install@v1 33 | with: 34 | useLockFile: false 35 | 36 | - name: 📦 Run Build 37 | run: npm run build 38 | 39 | - name: 🚀 Release 40 | uses: cycjimmy/semantic-release-action@v4 41 | with: 42 | semantic_version: 17 43 | branches: | 44 | [ 45 | '+([0-9])?(.{+([0-9]),x}).x', 46 | 'main', 47 | 'next', 48 | 'next-major', 49 | {name: 'beta', prerelease: true}, 50 | {name: 'alpha', prerelease: true} 51 | ] 52 | env: 53 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 54 | NPM_CONFIG_PROVENANCE: true 55 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }} 56 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | node_modules 3 | tsconfig.tsbuildinfo 4 | coverage 5 | /test-results/ 6 | /playwright-report/ 7 | /blob-report/ 8 | /playwright/.cache/ 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
7 | The <body>
isn't the only thing that scrolls. When the user scrolls a list, then navigates back and forth, you may want to keep their scroll position where it was when they left. This library makes that easy.
8 |