Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Search within Log viewer can cause the parent container to shift and break the layout, when embedded in a scrollable parent

Aperta
#106 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@fao89 ci sta già lavorando.

Dal 28/5/2026.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
67/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
typescript
Ambito
frontend

Direzione di ricerca

Start by reproducing the horizontal shift with the linked CodeSandbox, then read packages/module/src/LogViewer/LogViewer.tsx around lines 129-134 and inspect the log viewer scroll container. Verify that searching with isTextWrapped={false} scrolls only that container, leaving embedded ancestors unchanged; confirm the reproduction no longer shifts its parent layout.

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

Descrizione

Summary

When LogViewer is embedded inside a scrollable ancestor (e.g., PatternFly Drawer), searching with isTextWrapped={false} causes the entire page layout to shift horizontally. The scrollIntoView({ block: 'nearest', inline: 'center' }) call in LogViewer.js:132 scrolls all scrollable ancestors per the CSSOM View spec, not just the log viewer's own scroll container.

Description

When searching in LogViewer with text wrapping disabled (isTextWrapped={false}), the component calls scrollIntoView({ block: 'nearest', inline: 'center' }) on the matched .pf-v6-c-log-viewer__string.pf-m-current element (LogViewer.js:129-134):

if (!isTextWrapped) {
    setTimeout(() => {
        const element = containerRef.current.querySelector('.pf-v6-c-log-viewer__string.pf-m-current');
        element && element.scrollIntoView({ block: 'nearest', inline: 'center' });
    }, 1);
}

Per the CSSOM View spec, scrollIntoView scrolls all scrollable ancestors, not just the nearest one. This means any parent element with overflow: auto or overflow: hidden (which is still a scroll container) will also be scrolled horizontally.

Reproduction

A minimal reproduction is available here:
Search for the string dial and the entire Log View shifts to the left.
https://codesandbox.io/p/devbox/adoring-gianmarco-jysx57?file=%2Findex.js%3A57%2C27&workspaceId=ws_DaxE3H6rUUo4d5D65eiKhT

Expected behavior

Only the log viewer's own scroll container (.pf-v6-c-log-viewer__scroll-container) should scroll horizontally. Ancestor containers should not be affected.

OCP Console related issue and workaround

In OpenShift Console (OCPBUGS-74156), this causes the entire page to shift left when searching pod logs, because the LogViewer is nested inside a PatternFly Drawer whose .pf-v6-c-drawer__main has overflow: hidden -- which still acts as a scroll container for scrollIntoView.

As a workaround until this is addressed upstream, OpenShift Console plans to override overflow: hidden to overflow: clip on .pf-v6-c-drawer__main via a CSS override (UPDATE) overflow: clip caused another bug in our list page

CSS-only approaches were investigated but ruled out. The follow up PR #74156 Adds a scroll event listener in ResourceLog that resets scrollLeft to 0 on .pf-v6-c-drawer__main, preventing the page shift.


Jira Issue: PF-3815

Lingua principale
TypeScript
Stelle
34
Fork
19
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

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 patternfly/react-log-viewer

Tutte le issue di patternfly/react-log-viewer

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.