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

added "with-route-as-modal" example #11473

Merged
merged 3 commits into from
Mar 31, 2020
Merged

added "with-route-as-modal" example #11473

merged 3 commits into from
Mar 31, 2020

Conversation

IAmMorrow
Copy link
Contributor

This PR provide an exemple on how to achieve the modern "route as a modal" pattern using Next.js routing. This is achievable since the recent release ^9.2.1-canary.6.

Linking to #8023 as a few people are looking forward to achieve this.

@ijjk
Copy link
Member

ijjk commented Mar 29, 2020

Stats from current PR

Default Server Mode
General
zeit/next.js canary IAmMorrow/next.js canary Change
buildDuration 11.2s 11.3s ⚠️ +163ms
nodeModulesSize 52.8 MB 52.8 MB
Client Bundles (main, webpack, commons)
zeit/next.js canary IAmMorrow/next.js canary Change
main-HASH.js gzip 6.24 kB 6.24 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..c6c1.js gzip 10.1 kB 10.1 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.2 kB 56.2 kB
Client Bundles (main, webpack, commons) Modern
zeit/next.js canary IAmMorrow/next.js canary Change
main-HASH.module.js gzip 4.77 kB 4.77 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.71 kB 6.71 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 51.4 kB 51.4 kB
Legacy Client Bundles (polyfills)
zeit/next.js canary IAmMorrow/next.js canary Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
zeit/next.js canary IAmMorrow/next.js canary Change
_app.js gzip 1.24 kB 1.24 kB
_error.js gzip 3.15 kB 3.15 kB
hooks.js gzip 664 B 664 B
index.js gzip 222 B 222 B
link.js gzip 2.03 kB 2.03 kB
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
Overall change 7.86 kB 7.86 kB
Client Pages Modern
zeit/next.js canary IAmMorrow/next.js canary Change
_app.module.js gzip 594 B 594 B
_error.module.js gzip 2.08 kB 2.08 kB
hooks.module.js gzip 370 B 370 B
index.module.js gzip 212 B 212 B
link.module.js gzip 1.48 kB 1.48 kB
routerDirect..dule.js gzip 271 B 271 B
withRouter.m..dule.js gzip 270 B 270 B
Overall change 5.28 kB 5.28 kB
Client Build Manifests
zeit/next.js canary IAmMorrow/next.js canary Change
_buildManifest.js gzip 61 B 61 B
_buildManife..dule.js gzip 61 B 61 B
Overall change 122 B 122 B
Rendered Page Sizes
zeit/next.js canary IAmMorrow/next.js canary Change
index.html gzip 917 B 917 B
link.html gzip 925 B 925 B
withRouter.html gzip 915 B 915 B
Overall change 2.76 kB 2.76 kB

Serverless Mode (Decrease detected ✓)
General
zeit/next.js canary IAmMorrow/next.js canary Change
buildDuration 12.2s 11.9s -306ms
nodeModulesSize 52.8 MB 52.8 MB
Client Bundles (main, webpack, commons)
zeit/next.js canary IAmMorrow/next.js canary Change
main-HASH.js gzip 6.24 kB 6.24 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..c6c1.js gzip 10.1 kB 10.1 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.2 kB 56.2 kB
Client Bundles (main, webpack, commons) Modern
zeit/next.js canary IAmMorrow/next.js canary Change
main-HASH.module.js gzip 4.77 kB 4.77 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.71 kB 6.71 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 51.4 kB 51.4 kB
Legacy Client Bundles (polyfills)
zeit/next.js canary IAmMorrow/next.js canary Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
zeit/next.js canary IAmMorrow/next.js canary Change
_app.js gzip 1.24 kB 1.24 kB
_error.js gzip 3.15 kB 3.15 kB
hooks.js gzip 664 B 664 B
index.js gzip 222 B 222 B
link.js gzip 2.03 kB 2.03 kB
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
Overall change 7.86 kB 7.86 kB
Client Pages Modern
zeit/next.js canary IAmMorrow/next.js canary Change
_app.module.js gzip 594 B 594 B
_error.module.js gzip 2.08 kB 2.08 kB
hooks.module.js gzip 370 B 370 B
index.module.js gzip 212 B 212 B
link.module.js gzip 1.48 kB 1.48 kB
routerDirect..dule.js gzip 271 B 271 B
withRouter.m..dule.js gzip 270 B 270 B
Overall change 5.28 kB 5.28 kB
Client Build Manifests
zeit/next.js canary IAmMorrow/next.js canary Change
_buildManifest.js gzip 61 B 61 B
_buildManife..dule.js gzip 61 B 61 B
Overall change 122 B 122 B
Serverless bundles Overall decrease ✓
zeit/next.js canary IAmMorrow/next.js canary Change
_error.js gzip 294 kB 294 kB -200 B
404.html gzip 1.32 kB 1.32 kB
hooks.html gzip 958 B 958 B
index.js gzip 294 kB 294 kB -34 B
link.js gzip 302 kB 301 kB -847 B
routerDirect.js gzip 300 kB 300 kB -644 B
withRouter.js gzip 300 kB 300 kB ⚠️ +651 B
Overall change 1.49 MB 1.49 MB -1.07 kB

@ijjk
Copy link
Member

ijjk commented Mar 29, 2020

Stats from current PR

Default Server Mode
General
zeit/next.js canary IAmMorrow/next.js canary Change
buildDuration 10.9s 11.1s ⚠️ +255ms
nodeModulesSize 52.8 MB 52.8 MB
Client Bundles (main, webpack, commons)
zeit/next.js canary IAmMorrow/next.js canary Change
main-HASH.js gzip 6.24 kB 6.24 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..c6c1.js gzip 10.1 kB 10.1 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.2 kB 56.2 kB
Client Bundles (main, webpack, commons) Modern
zeit/next.js canary IAmMorrow/next.js canary Change
main-HASH.module.js gzip 4.77 kB 4.77 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.71 kB 6.71 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 51.4 kB 51.4 kB
Legacy Client Bundles (polyfills)
zeit/next.js canary IAmMorrow/next.js canary Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
zeit/next.js canary IAmMorrow/next.js canary Change
_app.js gzip 1.24 kB 1.24 kB
_error.js gzip 3.15 kB 3.15 kB
hooks.js gzip 664 B 664 B
index.js gzip 222 B 222 B
link.js gzip 2.03 kB 2.03 kB
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
Overall change 7.86 kB 7.86 kB
Client Pages Modern
zeit/next.js canary IAmMorrow/next.js canary Change
_app.module.js gzip 594 B 594 B
_error.module.js gzip 2.08 kB 2.08 kB
hooks.module.js gzip 370 B 370 B
index.module.js gzip 212 B 212 B
link.module.js gzip 1.48 kB 1.48 kB
routerDirect..dule.js gzip 271 B 271 B
withRouter.m..dule.js gzip 270 B 270 B
Overall change 5.28 kB 5.28 kB
Client Build Manifests
zeit/next.js canary IAmMorrow/next.js canary Change
_buildManifest.js gzip 61 B 61 B
_buildManife..dule.js gzip 61 B 61 B
Overall change 122 B 122 B
Rendered Page Sizes
zeit/next.js canary IAmMorrow/next.js canary Change
index.html gzip 917 B 917 B
link.html gzip 925 B 925 B
withRouter.html gzip 915 B 915 B
Overall change 2.76 kB 2.76 kB

Serverless Mode (Increase detected ⚠️)
General
zeit/next.js canary IAmMorrow/next.js canary Change
buildDuration 11.9s 12.2s ⚠️ +283ms
nodeModulesSize 52.8 MB 52.8 MB
Client Bundles (main, webpack, commons)
zeit/next.js canary IAmMorrow/next.js canary Change
main-HASH.js gzip 6.24 kB 6.24 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..c6c1.js gzip 10.1 kB 10.1 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.2 kB 56.2 kB
Client Bundles (main, webpack, commons) Modern
zeit/next.js canary IAmMorrow/next.js canary Change
main-HASH.module.js gzip 4.77 kB 4.77 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.71 kB 6.71 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 51.4 kB 51.4 kB
Legacy Client Bundles (polyfills)
zeit/next.js canary IAmMorrow/next.js canary Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
zeit/next.js canary IAmMorrow/next.js canary Change
_app.js gzip 1.24 kB 1.24 kB
_error.js gzip 3.15 kB 3.15 kB
hooks.js gzip 664 B 664 B
index.js gzip 222 B 222 B
link.js gzip 2.03 kB 2.03 kB
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
Overall change 7.86 kB 7.86 kB
Client Pages Modern
zeit/next.js canary IAmMorrow/next.js canary Change
_app.module.js gzip 594 B 594 B
_error.module.js gzip 2.08 kB 2.08 kB
hooks.module.js gzip 370 B 370 B
index.module.js gzip 212 B 212 B
link.module.js gzip 1.48 kB 1.48 kB
routerDirect..dule.js gzip 271 B 271 B
withRouter.m..dule.js gzip 270 B 270 B
Overall change 5.28 kB 5.28 kB
Client Build Manifests
zeit/next.js canary IAmMorrow/next.js canary Change
_buildManifest.js gzip 61 B 61 B
_buildManife..dule.js gzip 61 B 61 B
Overall change 122 B 122 B
Serverless bundles Overall increase ⚠️
zeit/next.js canary IAmMorrow/next.js canary Change
_error.js gzip 293 kB 294 kB ⚠️ +982 B
404.html gzip 1.32 kB 1.32 kB
hooks.html gzip 958 B 958 B
index.js gzip 294 kB 294 kB ⚠️ +100 B
link.js gzip 302 kB 301 kB -880 B
routerDirect.js gzip 300 kB 300 kB ⚠️ +420 B
withRouter.js gzip 300 kB 300 kB ⚠️ +261 B
Overall change 1.49 MB 1.49 MB ⚠️ +883 B

extra space missing in style.css

oops

linted
@ijjk
Copy link
Member

ijjk commented Mar 29, 2020

Stats from current PR

Default Server Mode
General
zeit/next.js canary IAmMorrow/next.js canary Change
buildDuration 9s 9.1s ⚠️ +52ms
nodeModulesSize 52.8 MB 52.8 MB
Client Bundles (main, webpack, commons)
zeit/next.js canary IAmMorrow/next.js canary Change
main-HASH.js gzip 6.24 kB 6.24 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..c6c1.js gzip 10.1 kB 10.1 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.2 kB 56.2 kB
Client Bundles (main, webpack, commons) Modern
zeit/next.js canary IAmMorrow/next.js canary Change
main-HASH.module.js gzip 4.77 kB 4.77 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.71 kB 6.71 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 51.4 kB 51.4 kB
Legacy Client Bundles (polyfills)
zeit/next.js canary IAmMorrow/next.js canary Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
zeit/next.js canary IAmMorrow/next.js canary Change
_app.js gzip 1.24 kB 1.24 kB
_error.js gzip 3.15 kB 3.15 kB
hooks.js gzip 664 B 664 B
index.js gzip 222 B 222 B
link.js gzip 2.03 kB 2.03 kB
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
Overall change 7.86 kB 7.86 kB
Client Pages Modern
zeit/next.js canary IAmMorrow/next.js canary Change
_app.module.js gzip 594 B 594 B
_error.module.js gzip 2.08 kB 2.08 kB
hooks.module.js gzip 370 B 370 B
index.module.js gzip 212 B 212 B
link.module.js gzip 1.48 kB 1.48 kB
routerDirect..dule.js gzip 271 B 271 B
withRouter.m..dule.js gzip 270 B 270 B
Overall change 5.28 kB 5.28 kB
Client Build Manifests
zeit/next.js canary IAmMorrow/next.js canary Change
_buildManifest.js gzip 61 B 61 B
_buildManife..dule.js gzip 61 B 61 B
Overall change 122 B 122 B
Rendered Page Sizes
zeit/next.js canary IAmMorrow/next.js canary Change
index.html gzip 917 B 917 B
link.html gzip 925 B 925 B
withRouter.html gzip 915 B 915 B
Overall change 2.76 kB 2.76 kB

Serverless Mode (Decrease detected ✓)
General
zeit/next.js canary IAmMorrow/next.js canary Change
buildDuration 10.3s 10.7s ⚠️ +470ms
nodeModulesSize 52.8 MB 52.8 MB
Client Bundles (main, webpack, commons)
zeit/next.js canary IAmMorrow/next.js canary Change
main-HASH.js gzip 6.24 kB 6.24 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..c6c1.js gzip 10.1 kB 10.1 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.2 kB 56.2 kB
Client Bundles (main, webpack, commons) Modern
zeit/next.js canary IAmMorrow/next.js canary Change
main-HASH.module.js gzip 4.77 kB 4.77 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.71 kB 6.71 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 51.4 kB 51.4 kB
Legacy Client Bundles (polyfills)
zeit/next.js canary IAmMorrow/next.js canary Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
zeit/next.js canary IAmMorrow/next.js canary Change
_app.js gzip 1.24 kB 1.24 kB
_error.js gzip 3.15 kB 3.15 kB
hooks.js gzip 664 B 664 B
index.js gzip 222 B 222 B
link.js gzip 2.03 kB 2.03 kB
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
Overall change 7.86 kB 7.86 kB
Client Pages Modern
zeit/next.js canary IAmMorrow/next.js canary Change
_app.module.js gzip 594 B 594 B
_error.module.js gzip 2.08 kB 2.08 kB
hooks.module.js gzip 370 B 370 B
index.module.js gzip 212 B 212 B
link.module.js gzip 1.48 kB 1.48 kB
routerDirect..dule.js gzip 271 B 271 B
withRouter.m..dule.js gzip 270 B 270 B
Overall change 5.28 kB 5.28 kB
Client Build Manifests
zeit/next.js canary IAmMorrow/next.js canary Change
_buildManifest.js gzip 61 B 61 B
_buildManife..dule.js gzip 61 B 61 B
Overall change 122 B 122 B
Serverless bundles Overall decrease ✓
zeit/next.js canary IAmMorrow/next.js canary Change
_error.js gzip 293 kB 294 kB ⚠️ +641 B
404.html gzip 1.32 kB 1.32 kB
hooks.html gzip 958 B 958 B
index.js gzip 294 kB 294 kB ⚠️ +69 B
link.js gzip 302 kB 301 kB -591 B
routerDirect.js gzip 300 kB 300 kB ⚠️ +8 B
withRouter.js gzip 300 kB 300 kB -778 B
Overall change 1.49 MB 1.49 MB -651 B

@IAmMorrow IAmMorrow changed the title added "with-route-as-modal" exemple added "with-route-as-modal" example Mar 30, 2020
@ijjk
Copy link
Member

ijjk commented Mar 30, 2020

Stats from current PR

Default Server Mode
General
zeit/next.js canary IAmMorrow/next.js canary Change
buildDuration 10.7s 10.7s ⚠️ +24ms
nodeModulesSize 52.8 MB 52.8 MB
Client Bundles (main, webpack, commons)
zeit/next.js canary IAmMorrow/next.js canary Change
main-HASH.js gzip 6.24 kB 6.24 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..c6c1.js gzip 10.1 kB 10.1 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.2 kB 56.2 kB
Client Bundles (main, webpack, commons) Modern
zeit/next.js canary IAmMorrow/next.js canary Change
main-HASH.module.js gzip 4.77 kB 4.77 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.71 kB 6.71 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 51.4 kB 51.4 kB
Legacy Client Bundles (polyfills)
zeit/next.js canary IAmMorrow/next.js canary Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
zeit/next.js canary IAmMorrow/next.js canary Change
_app.js gzip 1.24 kB 1.24 kB
_error.js gzip 3.15 kB 3.15 kB
hooks.js gzip 664 B 664 B
index.js gzip 222 B 222 B
link.js gzip 2.03 kB 2.03 kB
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
Overall change 7.86 kB 7.86 kB
Client Pages Modern
zeit/next.js canary IAmMorrow/next.js canary Change
_app.module.js gzip 594 B 594 B
_error.module.js gzip 2.08 kB 2.08 kB
hooks.module.js gzip 370 B 370 B
index.module.js gzip 212 B 212 B
link.module.js gzip 1.48 kB 1.48 kB
routerDirect..dule.js gzip 271 B 271 B
withRouter.m..dule.js gzip 270 B 270 B
Overall change 5.28 kB 5.28 kB
Client Build Manifests
zeit/next.js canary IAmMorrow/next.js canary Change
_buildManifest.js gzip 61 B 61 B
_buildManife..dule.js gzip 61 B 61 B
Overall change 122 B 122 B
Rendered Page Sizes
zeit/next.js canary IAmMorrow/next.js canary Change
index.html gzip 917 B 917 B
link.html gzip 925 B 925 B
withRouter.html gzip 915 B 915 B
Overall change 2.76 kB 2.76 kB

Serverless Mode (Increase detected ⚠️)
General
zeit/next.js canary IAmMorrow/next.js canary Change
buildDuration 11.5s 11.6s ⚠️ +136ms
nodeModulesSize 52.8 MB 52.8 MB
Client Bundles (main, webpack, commons)
zeit/next.js canary IAmMorrow/next.js canary Change
main-HASH.js gzip 6.24 kB 6.24 kB
webpack-HASH.js gzip 746 B 746 B
de003c3a9d30..c6c1.js gzip 10.1 kB 10.1 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 56.2 kB 56.2 kB
Client Bundles (main, webpack, commons) Modern
zeit/next.js canary IAmMorrow/next.js canary Change
main-HASH.module.js gzip 4.77 kB 4.77 kB
webpack-HASH..dule.js gzip 746 B 746 B
de003c3a9d30..dule.js gzip 6.71 kB 6.71 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 51.4 kB 51.4 kB
Legacy Client Bundles (polyfills)
zeit/next.js canary IAmMorrow/next.js canary Change
polyfills-HASH.js gzip 26.3 kB 26.3 kB
Overall change 26.3 kB 26.3 kB
Client Pages
zeit/next.js canary IAmMorrow/next.js canary Change
_app.js gzip 1.24 kB 1.24 kB
_error.js gzip 3.15 kB 3.15 kB
hooks.js gzip 664 B 664 B
index.js gzip 222 B 222 B
link.js gzip 2.03 kB 2.03 kB
routerDirect.js gzip 279 B 279 B
withRouter.js gzip 278 B 278 B
Overall change 7.86 kB 7.86 kB
Client Pages Modern
zeit/next.js canary IAmMorrow/next.js canary Change
_app.module.js gzip 594 B 594 B
_error.module.js gzip 2.08 kB 2.08 kB
hooks.module.js gzip 370 B 370 B
index.module.js gzip 212 B 212 B
link.module.js gzip 1.48 kB 1.48 kB
routerDirect..dule.js gzip 271 B 271 B
withRouter.m..dule.js gzip 270 B 270 B
Overall change 5.28 kB 5.28 kB
Client Build Manifests
zeit/next.js canary IAmMorrow/next.js canary Change
_buildManifest.js gzip 61 B 61 B
_buildManife..dule.js gzip 61 B 61 B
Overall change 122 B 122 B
Serverless bundles Overall increase ⚠️
zeit/next.js canary IAmMorrow/next.js canary Change
_error.js gzip 294 kB 294 kB ⚠️ +622 B
404.html gzip 1.32 kB 1.32 kB
hooks.html gzip 958 B 958 B
index.js gzip 294 kB 294 kB ⚠️ +154 B
link.js gzip 302 kB 301 kB -569 B
routerDirect.js gzip 300 kB 300 kB -42 B
withRouter.js gzip 300 kB 300 kB -39 B
Overall change 1.49 MB 1.49 MB ⚠️ +126 B

@lfades
Copy link
Member

lfades commented Mar 31, 2020

@IAmMorrow Can you enable contributions please, I can't push to your branch:

Screenshot from 2020-03-31 12-00-18

@IAmMorrow
Copy link
Contributor Author

image

It was already enabled, I do not understand ?!

@lfades
Copy link
Member

lfades commented Mar 31, 2020

Nvm, looks like I was having conflicts with my local canary's 😌

Copy link
Member

@lfades lfades left a comment

Choose a reason for hiding this comment

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

@IAmMorrow Thank you!

@lfades lfades merged commit 2263876 into vercel:canary Mar 31, 2020
@lachlanjc
Copy link
Contributor

Lovely!! Have already used this for reference. Great contribution.

@dminkovsky
Copy link

dminkovsky commented Apr 5, 2020

I looked at the example but couldn't figure out: What new Next.js feature enables this? Seems like everything I am seeing in this example you could do just fine before?

@lachlanjc
Copy link
Contributor

@dminkovsky It’s not new functionality, we just didn’t previously have an example showing how to do it

@dminkovsky
Copy link

Ahhh. I guess I assumed it was related to something new because I saw it in the release notes for v9.3.4, but of course that just says the example was added. Thanks for clarifying @lachlanjc.

@raghavendracs
Copy link

Thanks for this example, but I have a small problem with remembering scroll positions.

I am displaying a long list of images in a Masonry Grid using react-virtualized. While the modal is showing up correctly etc, the scroll position within the grid is being lost. It is always displaying modal at the top of the page and keeps me there when I close the modal.

Any help on what the mistake I might be doing?

@Ferezoz
Copy link

Ferezoz commented Jul 21, 2020

I just donwloaded the example and is not keeping the scroll position, when you open the modal it refreshes the scroll position to the top of the page, do you know how we can achieve this?

@lfades
Copy link
Member

lfades commented Jul 25, 2020

Link scrolls to the top of the page by default, you can disable that behavior with scroll={false}: https://nextjs.org/docs/api-reference/next/link#disable-scrolling-to-the-top-of-the-page

@Ferezoz
Copy link

Ferezoz commented Jul 27, 2020

@lfades Oh thank you very much!

@vercel vercel locked as resolved and limited conversation to collaborators Jan 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants