Skip to content

Commit 91ecb56

Browse files
Allow over-wide followup buttons to wrap text instead of overflowing
Co-authored-by: Shawn Borton <shawnborton@users.noreply.github.com>
1 parent 96805af commit 91ecb56

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/components/ReportActionItem/ActionableItemButtons.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,19 @@ function ActionableItemButtons(props: ActionableItemButtonsProps) {
2929
const styles = useThemeStyles();
3030
const {translate} = useLocalize();
3131

32+
const isHorizontal = props.layout === 'horizontal';
33+
3234
return (
33-
<View style={[styles.gap2, styles.mt2, props.layout === 'horizontal' ? [styles.flexRow, styles.flexWrap] : [styles.flexColumn, styles.alignItemsStart]]}>
35+
<View style={[styles.gap2, styles.mt2, isHorizontal ? [styles.flexRow, styles.flexWrap] : [styles.flexColumn, styles.alignItemsStart]]}>
3436
{props.items?.map((item) => (
3537
<Button
3638
key={item.key}
3739
onPress={item.onPress}
3840
text={props.shouldUseLocalization ? translate(item.text as TranslationPaths) : item.text}
3941
medium
4042
success={item.isPrimary}
43+
// Let a button that is wider than the viewport shrink to fit and wrap its text to multiple lines instead of overflowing horizontally
44+
style={isHorizontal ? [styles.flexShrink1, styles.mw100] : undefined}
4145
innerStyles={props.styles?.button}
4246
primaryTextNumberOfLines={props.primaryTextNumberOfLines}
4347
textStyles={props.styles?.text}

0 commit comments

Comments
 (0)