An `absolute` element near the end of a long page gives the toolkit main surface a second scrollbar

Aperta Adatta ai principianti
#8,846 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@builder-factory ci sta già lavorando.

Dal 6/11/2026.

  • #8851 di @builder-factory — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
77/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
react, tailwindcss, typescript
Ambito
frontend

Direzione di ricerca

Inizia da .agent-native-app-main in packages/toolkit/src/app/styles/agent-native.css e dal layout della chat in templates/chat/app/components/layout/Layout.tsx:166; confronta le dimensioni di scorrimento di main e della superficie descritte nell’issue. Verifica se qualche template dipende dal fatto che gli elementi figli posizionati in modo assoluto siano ancorati alla superficie, quindi verifica con un main alto che contenga un elemento sr-only alla fine. Il lavoro è completato quando lo scrollHeight della superficie non supera il suo clientHeight e main resta l’area di scorrimento.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Environment: app from the chat template in a workspace, @agent-native/toolkit 0.223.0, Chrome on Windows 11. The code is unchanged on main at 959c68cb42; nothing here is platform-specific.

What happens: on a page taller than the window, the page shows two nested scrollbars: the main of the app, and an outer one that scrolls the whole screen, header included. Measured on one such page: main had scrollHeight 1373 / clientHeight 952, and div.agent-sidebar-main-surface had scrollHeight 1226 / clientHeight 1016, while its visible content ends at 1016.

Why:

  • div.agent-sidebar-main-surface (packages/toolkit/src/app/chat/AgentSidebar.tsx:1928) is overflow-auto and position: relative (packages/toolkit/src/app/styles/agent-native.css:347).
  • The template's main is overflow-y-auto with no position: templates/chat/app/components/layout/Layout.tsx:166 (agent-native-app-main min-w-0 flex-1 overflow-y-auto overscroll-contain). The same holds for brain, factory, analytics, calendar, plan, forms, assets and clips; only content adds relative. .agent-native-app-main (agent-native.css:384) only sets container.
  • A position: absolute element inside that main, with no positioned ancestor in between, has the surface as its containing block, so the main's overflow does not clip it. With no top/bottom it stays at its static position, which is where it would be in the unscrolled main. On a page taller than the window that position is past the end of the surface, and the surface gets its own scrollbar.
  • In my case the element was <legend class="sr-only"> in a fieldset. Tailwind's sr-only is position: absolute, so any screen-reader-only label near the end of a long page triggers it.

Workaround: add relative to the main in the app's layout. After that only the main scrolls.

Possible fix: add position: relative to .agent-native-app-main in packages/toolkit/src/app/styles/agent-native.css. One place covers every template that uses the class, and already-created apps get it without a template sync. The alternative, relative on each template's main, touches more files and doesn't reach existing apps. I haven't searched every template for an absolute child of main that relies on being anchored to the surface; reading the classes found none.

Test: a main with content taller than the window and a sr-only element at the end; the surface must not have scrollHeight greater than clientHeight.

Lingua principale
TypeScript
Stelle
7.7k
Fork
706
Merge medio
1g 11h
PR unite (30g)
790

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di BuilderIO/agent-native

Tutte le issue di BuilderIO/agent-native

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.