Checkbox: a long description pushes the control out of its container — the label column cannot shrink

Aperta Adatta ai principianti
#662 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Foxhoundn ci sta già lavorando.

Dal 12/10/2026.

  • #715 di @Foxhoundn — aperta

Valutazione

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

Direzione di ricerca

Inizia da src/components/Checkbox/index.tsx e analizza StyledCheckbox e il ReqoreControlGroup verticale usato per l’etichetta e la descrizione. Riproduci l’overflow con una descrizione lunga in un contenitore stretto, quindi aggiungi, come proposto, un controllo a livello di story per un contenitore di 320px. Il lavoro è completato quando il testo della casella di controllo va a capo e rimane all’interno del contenitore, mentre l’interruttore mantiene le sue dimensioni naturali.

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

Descrizione

Symptom

A ReqoreCheckbox (asSwitch, fluid, wrapLabel) with a two-sentence description inside a 340px-wide modal renders its label/description block up to ~190px past the modal's right edge. The text does not wrap; the whole control overflows. Seen in qorus-ide's notification preferences dialog at phone width (380px), where every switch's text ran outside the dialog.

Root cause

src/components/Checkbox/index.tsx: StyledCheckbox is display: inline-flex with a fixed height, and the label block is a ReqoreControlGroup vertical that has no min-width: 0 and no flex-shrink. wrapLabel only toggles noWrap on the label text effect; the .reqore-checkbox-description text effect is never allowed to wrap and the column is never allowed to shrink, so the block keeps its unwrapped content width.

Proposed fix

When wrapLabel is set (or always when fluid): give the label column min-width: 0; flex: 1 1 auto, and let the description wrap (white-space: normal). The switch/box keeps its natural size (flex: 0 0 auto). A story with a long description in a 320px container should assert nothing with text leaves the container.

Where it was worked around

qorus-ide (src/components/Notifications/NotificationsPrefsModal.tsx) now renders each preference as its own row — a text column with flex: 1 1 0%; min-width: 0 beside a fixed switch — instead of using the checkbox's label/description. That is a fine layout for a settings row, but the component should not overflow when handed a long description.

Lingua principale
TypeScript
Stelle
4
Fork
0
Merge medio
16h 28m
PR unite (30g)
9

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 qoretechnologies/reqore

Tutte le issue di qoretechnologies/reqore

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.