Repository navigation
Description
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(fix(html5): keep media-sharing and confirmation buttons at a consistent size bigbluebutton#25942) - Take/request presenter button in the media-sharing popover:
white-space: normal(fix(html5): keep media-sharing and confirmation buttons at a consistent size 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.
Activity
fix(breakout): keep the room cards' join buttons at their normal height
fix(breakout): keep the room cards' join buttons at their normal height
fix(breakout): keep the room cards' join buttons at their normal height
fix(breakout): keep the room cards' join buttons at their normal height
refactor(html5): replace BBButton wrappers with library props, bump b…