Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
3a4833af
Commit
3a4833af
authored
Apr 03, 2026
by
Jimmy Lai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: add failing test for #79571 - parallel routes sticky header blocks scroll-to-top
parent
daca04d0
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
174 additions
and
0 deletions
+174
-0
default.tsx
...allel-routes-sticky-header-scroll/app/@header/default.tsx
+15
-0
page.tsx
...l-routes-sticky-header-scroll/app/@header/page-a/page.tsx
+17
-0
page.tsx
...l-routes-sticky-header-scroll/app/@header/page-b/page.tsx
+17
-0
layout.tsx
...p-dir/parallel-routes-sticky-header-scroll/app/layout.tsx
+28
-0
page.tsx
.../parallel-routes-sticky-header-scroll/app/page-a/page.tsx
+21
-0
page.tsx
.../parallel-routes-sticky-header-scroll/app/page-b/page.tsx
+16
-0
page.tsx
...app-dir/parallel-routes-sticky-header-scroll/app/page.tsx
+12
-0
next.config.js
...p-dir/parallel-routes-sticky-header-scroll/next.config.js
+4
-0
parallel-routes-sticky-header-scroll.test.ts
...eader-scroll/parallel-routes-sticky-header-scroll.test.ts
+44
-0
No files found.
test/e2e/app-dir/parallel-routes-sticky-header-scroll/app/@header/default.tsx
0 → 100644
View file @
3a4833af
import
Link
from
'next/link'
export
default
function
DefaultHeader
()
{
return
(
<
nav
>
<
Link
href=
"/page-a"
id=
"header-link-a"
>
Go to Page A
</
Link
>
{
' | '
}
<
Link
href=
"/page-b"
id=
"header-link-b"
>
Go to Page B
</
Link
>
</
nav
>
)
}
test/e2e/app-dir/parallel-routes-sticky-header-scroll/app/@header/page-a/page.tsx
0 → 100644
View file @
3a4833af
import
Link
from
'next/link'
export
default
function
HeaderPageA
()
{
return
(
<
nav
>
<
span
id=
"header-page-a"
>
Header: Page A
</
span
>
{
' | '
}
<
Link
href=
"/page-a"
id=
"header-link-a"
>
Go to Page A
</
Link
>
{
' | '
}
<
Link
href=
"/page-b"
id=
"header-link-b"
>
Go to Page B
</
Link
>
</
nav
>
)
}
test/e2e/app-dir/parallel-routes-sticky-header-scroll/app/@header/page-b/page.tsx
0 → 100644
View file @
3a4833af
import
Link
from
'next/link'
export
default
function
HeaderPageB
()
{
return
(
<
nav
>
<
span
id=
"header-page-b"
>
Header: Page B
</
span
>
{
' | '
}
<
Link
href=
"/page-a"
id=
"header-link-a"
>
Go to Page A
</
Link
>
{
' | '
}
<
Link
href=
"/page-b"
id=
"header-link-b"
>
Go to Page B
</
Link
>
</
nav
>
)
}
test/e2e/app-dir/parallel-routes-sticky-header-scroll/app/layout.tsx
0 → 100644
View file @
3a4833af
export
default
function
RootLayout
({
children
,
header
,
}:
{
children
:
React
.
ReactNode
header
:
React
.
ReactNode
})
{
return
(
<
html
>
<
body
>
<
div
style=
{
{
position
:
'sticky'
,
top
:
0
,
background
:
'white'
,
zIndex
:
100
,
borderBottom
:
'1px solid #ccc'
,
padding
:
'10px'
,
}
}
id=
"sticky-header"
>
{
header
}
</
div
>
<
main
>
{
children
}
</
main
>
</
body
>
</
html
>
)
}
test/e2e/app-dir/parallel-routes-sticky-header-scroll/app/page-a/page.tsx
0 → 100644
View file @
3a4833af
import
Link
from
'next/link'
export
default
function
PageA
()
{
return
(
<
div
>
<
h1
id=
"page-a-title"
>
Page A
</
h1
>
{
/* Tall content to enable scrolling */
}
<
div
style=
{
{
height
:
'2000px'
,
background
:
'linear-gradient(#e0e0e0, #a0a0a0)'
,
}
}
>
<
p
>
Tall content to enable scrolling
</
p
>
</
div
>
<
Link
href=
"/page-b"
id=
"link-to-b"
>
Go to Page B
</
Link
>
</
div
>
)
}
test/e2e/app-dir/parallel-routes-sticky-header-scroll/app/page-b/page.tsx
0 → 100644
View file @
3a4833af
export
default
function
PageB
()
{
return
(
<
div
>
<
h1
id=
"page-b-title"
>
Page B Content
</
h1
>
{
/* Tall content so the browser doesn't auto-scroll when page height changes */
}
<
div
style=
{
{
height
:
'3000px'
,
background
:
'linear-gradient(#c0d0e0, #8090a0)'
,
}
}
>
<
p
>
Tall content on page B
</
p
>
</
div
>
</
div
>
)
}
test/e2e/app-dir/parallel-routes-sticky-header-scroll/app/page.tsx
0 → 100644
View file @
3a4833af
import
Link
from
'next/link'
export
default
function
Home
()
{
return
(
<
div
>
<
h1
>
Home Page
</
h1
>
<
Link
href=
"/page-a"
id=
"link-to-a"
>
Go to Page A
</
Link
>
</
div
>
)
}
test/e2e/app-dir/parallel-routes-sticky-header-scroll/next.config.js
0 → 100644
View file @
3a4833af
/** @type {import('next').NextConfig} */
const
nextConfig
=
{}
module
.
exports
=
nextConfig
test/e2e/app-dir/parallel-routes-sticky-header-scroll/parallel-routes-sticky-header-scroll.test.ts
0 → 100644
View file @
3a4833af
import
{
nextTestSetup
}
from
'e2e-utils'
import
{
retry
}
from
'next-test-utils'
describe
(
'parallel-routes-sticky-header-scroll'
,
()
=>
{
const
{
next
}
=
nextTestSetup
({
files
:
__dirname
,
})
// Reproduces https://github.com/vercel/next.js/issues/79571
// When a parallel route slot is rendered inside a sticky header,
// navigating between pages should still scroll to the top.
// The bug: all new CacheNodes share a single scrollRef, and the
// sticky header slot consumes it before the main content can scroll.
it
(
'should scroll to the top when navigating between pages with a parallel route in a sticky header'
,
async
()
=>
{
const
browser
=
await
next
.
browser
(
'/page-a'
)
// Wait for page-a content to be visible
await
browser
.
waitForElementByCss
(
'#page-a-title'
)
// Scroll to the bottom of the page where the "Go to Page B" link is
await
browser
.
eval
(
'document.getElementById("link-to-b").scrollIntoView()'
)
// Verify we have actually scrolled down
await
retry
(
async
()
=>
{
const
scrollY
=
await
browser
.
eval
(
'window.scrollY'
)
expect
(
scrollY
).
toBeGreaterThan
(
500
)
})
// Click the "Go to Page B" link at the bottom of the page
await
browser
.
elementByCss
(
'#link-to-b'
).
click
()
// Wait for Page B content to appear
await
browser
.
waitForElementByCss
(
'#page-b-title'
)
// The page should have scrolled back to the top.
// This fails because the sticky header's parallel route slot consumes the
// shared scrollRef (set in ppr-navigations.ts accumulateScrollRef) before
// the main content slot's scroll handler can use it.
await
retry
(
async
()
=>
{
const
scrollY
=
await
browser
.
eval
(
'window.scrollY'
)
expect
(
scrollY
).
toBe
(
0
)
})
})
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment