Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,21 @@ describe('provider-neutral URL field', () => {
expect(mocks.push).not.toHaveBeenCalled();
});

it('keeps the one-line field from wrapping and clipping its placeholder', async () => {
const tree = await renderLoaded();
const input = propsOf(find(tree, 'TextInput', () => true));
// The field is one line tall, so Android must not wrap the hint onto a
// second line: the hint's second line was drawn below the field's own
// bounds and clipped at its bottom edge (explorer capture). numberOfLines
// caps the native hint layout at one line instead of wrapping it.
expect(input.numberOfLines).toBe(1);
expect(input.multiline).toBeFalsy();
// Height comes from min-h-* (see apps/mobile/AGENTS.md), never py-*:
// vertical padding draws the single-line text below the middle.
expect(String(input.className)).toContain('min-h-14');
expect(String(input.className)).not.toContain('py-3');
});

it('shows the clear control only once the field has text', async () => {
const before = await renderLoaded();
expect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,16 @@ export function PrReviewEntryScreen() {
inputValueRef.current = value;
setHasInput(value.length > 0);
}}
// A one-line field: without numberOfLines the native hint wraps
// onto a second line the field's bounds then clip at the bottom
// edge (Android explorer capture). The cap keeps the hint on one
// line; the label above already states what the field takes.
numberOfLines={1}
// leading-[normal] so no lineHeight reaches the style: an explicit lineHeight
// makes iOS draw the placeholder lower than the typed text (see AGENTS.md).
className="min-w-0 flex-1 bg-transparent py-3 pl-3 pr-1 text-base text-foreground leading-[normal]"
// min-h-14 (not py-3) sizes the field: vertical padding draws the
// single-line text below the middle (see AGENTS.md).
className="min-h-14 min-w-0 flex-1 bg-transparent pl-3 pr-1 text-base text-foreground leading-[normal]"
accessibilityLabel={t('prReview.entry.urlAccessibility')}
returnKeyType="go"
onSubmitEditing={handleSubmit}
Expand Down
Loading