[Feature Request]: Badge component should support text truncation with ellipsis
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- react, scss, typescript
- Ambito
- frontend
Direzione di ricerca
Start by locating the Badge component implementation and its tests, then inspect how its internal markup handles children and sizing. Check how Badge is used in Table cells and how the component’s styling is tested. Done means an opt-in truncation behavior shows an ellipsis as the available width changes without forcing the table row to grow.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
Use case
When using Badge inside a Table cell to display dynamic content (e.g., resource tags like aws:cloudformation:stack-name=my-very-long-stack-name), long text causes the Badge to expand beyond the column width. Since Badge renders as an inline-block element, the table row height increases when the column is resized and the Badge cannot wrap internally, so it forces the row to grow.
There is currently no way to constrain Badge content with standard CSS (overflow: hidden; text-overflow: ellipsis; white-space: nowrap) because the text is not a direct child of the overflow container, it's nested inside Badge's internal markup.
Proposed solution
Add a truncate boolean prop (or similar) to Badge that enables single-line text overflow with ellipsis:
<Badge truncate>aws:cloudformation:stack-name=my-very-long-value</Badge>
When enabled, the Badge's internal text container would apply:
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
And the Badge itself would respect a max-width (either from a parent container or an explicit prop) rather than always sizing to its content.
Workarounds attempted
- Wrapping Badge in a div with overflow: hidden — clips visually but does not show ellipsis
- Placing a styled span inside Badge children with text-overflow: ellipsis — does not respond to column resizing because Badge sizes to its content, creating a circular width dependency
- Programmatic text truncation
(string.slice(0, N) + '…')— works but is not responsive to layout changes
Code of Conduct
- I agree to follow this project's Code of Conduct
- I checked the current issues for duplicate requests
- Lingua principale
- TypeScript
- Stelle
- 2.7k
- Fork
- 248
- Merge medio
- 3g 14h
- PR unite (30g)
- 83
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di cloudscape-design/components
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
cloudscape-design/components#5184 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
cloudscape-design/components#5152 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
cloudscape-design/components#5149 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
cloudscape-design/components#5117 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
cloudscape-design/components#5106 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di cloudscape-design/components
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
braintrustdata/braintrust-sdk-javascript#2659 ·
I maintainer di solito rispondono entro 1 giorno
-
body-parser 2.3.0 in the published ai-dial-chat-bff image is vulnerable (CVE-2026-111181, HIGH)Forse già presa @illya-havsiyevych l’ha presa oggi. Apertabug
Difficoltà 1/5 1-3 ore Idoneità per principianti 87/100
epam/ai-dial-chat#9566 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 1 giorno
-
はさみアイコンを修正するApertabug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
-
resource.reload() while params is in error switches the resource to 'idle' instead of retryingApertaarea: core
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno