mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
We try to focus the new Segment after navigation. This behavior currently has now tests. I plan to change that behavior behind `experimental.appNewScrollHandler` so I'm adding some tests for the current behavior. The test is also meant as a fixture for manual testing with a screen reader.
40 lines
967 B
TypeScript
40 lines
967 B
TypeScript
import Link from 'next/link'
|
|
|
|
export default function UriFragmentsPage() {
|
|
return (
|
|
<>
|
|
<nav aria-label="table of contents">
|
|
<ol>
|
|
<li>
|
|
<Link href="#section-1">Section 1</Link>
|
|
</li>
|
|
<li>
|
|
<Link href="#section-2">Section 2</Link>
|
|
</li>
|
|
<li>
|
|
<Link href="#section-3">Section 3</Link>
|
|
</li>
|
|
</ol>
|
|
</nav>
|
|
|
|
<article style={{ height: '50vh', overflow: 'scroll' }}>
|
|
<h1>A post</h1>
|
|
|
|
<p style={{ height: '100vh' }}>some long intro</p>
|
|
|
|
<h2 id="section-1">Section 1</h2>
|
|
<p style={{ height: '100vh' }}>bla</p>
|
|
|
|
<h2 id="section-2">Section 2</h2>
|
|
<p style={{ height: '100vh' }}>bla</p>
|
|
|
|
<h2 id="section-3">Section 3</h2>
|
|
<p style={{ height: '100vh' }}>bla</p>
|
|
|
|
<h2 id="section-4">Section 4</h2>
|
|
<p style={{ height: '100vh' }}>bla</p>
|
|
</article>
|
|
</>
|
|
)
|
|
}
|