Skip to content

Commit dab04fc

Browse files
committed
fix(capsule): keep confirm icon inside pill on done/error states
1 parent 003b713 commit dab04fc

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

openless-all/app/src/components/Capsule.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ function CenterText({ os, kind, text, color = 'var(--ol-ink-3)' }: CenterTextPro
8383
fontSize: 11,
8484
fontWeight: 500,
8585
color,
86-
width: metrics.textWidth,
86+
width: '100%',
87+
maxWidth: metrics.textWidth,
88+
minWidth: 0,
8789
textAlign: 'center',
8890
lineHeight: layout.allowWrap ? 1.2 : 1,
8991
whiteSpace: layout.allowWrap ? 'normal' : 'nowrap',
@@ -176,7 +178,9 @@ function Pill({ os, state, level, insertedChars, message, onCancel, onConfirm }:
176178
flexDirection: os === 'win' ? 'column' : 'row',
177179
alignItems: 'center',
178180
gap: os === 'win' ? 4 : 6,
179-
width: metrics.textWidth,
181+
width: '100%',
182+
maxWidth: metrics.textWidth,
183+
minWidth: 0,
180184
justifyContent: 'center',
181185
}}
182186
>
@@ -186,6 +190,7 @@ function Pill({ os, state, level, insertedChars, message, onCancel, onConfirm }:
186190
fontSize: 10.5,
187191
fontWeight: 500,
188192
color: 'var(--ol-ink-2)',
193+
minWidth: 0,
189194
textAlign: 'center',
190195
lineHeight: processingLayout.allowWrap ? 1.15 : 1,
191196
whiteSpace: processingLayout.allowWrap ? 'normal' : 'nowrap',
@@ -249,7 +254,7 @@ function Pill({ os, state, level, insertedChars, message, onCancel, onConfirm }:
249254
}}
250255
>
251256
<CircleButton variant="cancel" enabled={enabled} onClick={onCancel} />
252-
<div style={{ flex: 1, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
257+
<div style={{ flex: 1, minWidth: 0, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
253258
{center}
254259
</div>
255260
<CircleButton variant="confirm" enabled={enabled} onClick={onConfirm} />

0 commit comments

Comments
 (0)