BBButton: let a long label wrap instead of overflowing
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- Mezza giornata
- Idoneità per principianti
- 45/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- react, typescript
- Ambito
- frontend
Direzione di ricerca
Start in src/components/Button/styles.ts, where commonButtonStyles sets white-space: nowrap, and compare it with the stacked layout's ButtonText clamp. Check how the component passes className through, since the issue relies on that. Before coding, get a maintainer decision on wrap-by-default versus an opt-in wrapLabel prop. Done means a long label wraps inside a narrow fullWidth container, short labels look unchanged, and a Storybook story or test covers both cases.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is your feature request related to a problem? Please describe.
BBButton never wraps its label: commonButtonStyles sets white-space: nowrap. When the button can't grow, for example a fullWidth button in a narrow popover or a dialog footer on a phone, a long translation overflows the button instead of breaking onto a second line.
The BigBlueButton 4.0 client already overrides this in three places:
- Confirmation modal footer:
white-space: normal(bigbluebutton/bigbluebutton#25942) - Take/request presenter button in the media-sharing popover:
white-space: normal(bigbluebutton/bigbluebutton#25942) - Poll "add option" button:
white-space: pre-wrap, through a wrapper's& > buttonrule
Since 0.9.0 forwards className, each override is a one-liner. But every consumer only finds out it needs one after a label overflows in some language.
Describe the solution you'd like
Either of these:
- Wrap by default.
BBButtonisinline-flexand sizes itself to its label, so a label only wraps when its container is narrower than the label. A button with room renders exactly as today. Thestackedlayout already wraps:ButtonTextclamps to two lines. - An opt-in prop,
wrapLabel?: boolean, for the default layout.
The truncation request (#106) is the other answer to the same overflow. Both could share one prop, for example labelOverflow?: 'nowrap' | 'wrap' | 'ellipsis'.
Describe alternatives you've considered
styled(BBButton) with white-space: normal at each call site, which is what the client does today.
Affected component(s)
BBButton
Proposed API / Usage Example
// Wrapping by default: no change at call sites.
<BBButton label={intl.formatMessage(messages.takePresenter)} fullWidth size="sm" onClick={take} />
// Or opt-in:
<BBButton label={longLabel} fullWidth wrapLabel onClick={take} />
Additional context
A wrapped label makes the button taller, for example 37px to 56px at sm, so buttons in a row can end up with different heights. The client accepts that, because the alternative is an overflowing label.
- Lingua principale
- TypeScript
- Stelle
- 2
- Fork
- 5
- Merge medio
- 1g 16h
- PR unite (30g)
- 12
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
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 bigbluebutton/bbb-ui-components-react
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
bigbluebutton/bbb-ui-components-react#108 ·
I maintainer di solito rispondono entro 2 giorni
-
BBButton: subtle variant with neutral color has an opaque white background, so it renders white on white in dark modeForse di nuovo libera @nisatsama l’ha presa 10 giorni fa e non c’è nessuna pull request aperta. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
bigbluebutton/bbb-ui-components-react#100 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
bigbluebutton/bbb-ui-components-react#107 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 3/5 Mezza giornata Idoneità per principianti 55/100
bigbluebutton/bbb-ui-components-react#106 ·
I maintainer di solito rispondono entro 2 giorni
-
Add support for dark themeApertaenhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
bigbluebutton/bbb-ui-components-react#87 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di bigbluebutton/bbb-ui-components-react
Issue simili
-
Add: Yemen Education SDApertastreams:add
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
apache/rocketmq-dashboard#6872 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
interledger/publisher-tools#931 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
ARTPARK-SAHAI-ORG/calibrate-frontend#727 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
fab-geocommuns/RNB-site#539 ·
I maintainer di solito rispondono entro 2 giorni