Skip to content

Commit 1c60415

Browse files
authored
fix(landing): contain sr-only logos heading to stop phantom root scrollbar (#5585)
1 parent da2371a commit 1c60415

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

apps/sim/app/(landing)/components/platform-page/components/platform-logos-row/platform-logos-row.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,16 @@ import { Logos } from '@/app/(landing)/components/logos'
99
*
1010
* Wrapped as a labelled `<section>` so it is a discrete, crawlable landmark; the
1111
* heading is sr-only because the logos are a proof band rather than a content
12-
* section, but the H2 keeps the page's heading hierarchy intact.
12+
* section, but the H2 keeps the page's heading hierarchy intact. The section is
13+
* `relative` so the `sr-only` (`position: absolute`) heading is contained by it
14+
* rather than falling back to the document root - matching {@link Features}'s
15+
* `relative` wrapper for its own `sr-only` heading, and avoiding a phantom root
16+
* scrollbar (the heading's un-offset static position would otherwise inflate
17+
* `document.documentElement`'s scroll height by its own position in the page).
1318
*/
1419
export function PlatformLogosRow() {
1520
return (
16-
<section id='platform-logos' aria-labelledby='platform-logos-heading'>
21+
<section id='platform-logos' aria-labelledby='platform-logos-heading' className='relative'>
1722
<h2 id='platform-logos-heading' className='sr-only'>
1823
Companies building AI agents with Sim
1924
</h2>

apps/sim/app/(landing)/components/solutions-page/components/solutions-logos-row/solutions-logos-row.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,16 @@ import { Logos } from '@/app/(landing)/components/logos'
99
*
1010
* Wrapped as a labelled `<section>` so it is a discrete, crawlable landmark; the
1111
* heading is sr-only because the logos are a proof band rather than a content
12-
* section, but the H2 keeps the page's heading hierarchy intact.
12+
* section, but the H2 keeps the page's heading hierarchy intact. The section is
13+
* `relative` so the `sr-only` (`position: absolute`) heading is contained by it
14+
* rather than falling back to the document root - matching {@link Features}'s
15+
* `relative` wrapper for its own `sr-only` heading, and avoiding a phantom root
16+
* scrollbar (the heading's un-offset static position would otherwise inflate
17+
* `document.documentElement`'s scroll height by its own position in the page).
1318
*/
1419
export function SolutionsLogosRow() {
1520
return (
16-
<section id='solutions-logos' aria-labelledby='solutions-logos-heading'>
21+
<section id='solutions-logos' aria-labelledby='solutions-logos-heading' className='relative'>
1722
<h2 id='solutions-logos-heading' className='sr-only'>
1823
Companies building AI agents with Sim
1924
</h2>

0 commit comments

Comments
 (0)