From b1ca2503de55c41431aac38db4d164da7d506d4f Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Wed, 25 Sep 2024 15:54:43 -0500 Subject: Add language filtering UI to search (#5459) * Use new TextField for search bar * Add lang dropdown * Dialog * Revert "Dialog" This reverts commit 257573cd9c2a70d29df4ef5bdd503eea4ae411fe. * Extract util, test, cleanup * Fix formatting * Pass through other params * Fix sticky header * Fix stale data, hide/show * Improve query parsing * Replace memo * Couple tweaks * Revert cancel change * Remove unused placeholder --- src/components/forms/TextField.tsx | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'src/components/forms/TextField.tsx') diff --git a/src/components/forms/TextField.tsx b/src/components/forms/TextField.tsx index 94ee261e3..21928d3df 100644 --- a/src/components/forms/TextField.tsx +++ b/src/components/forms/TextField.tsx @@ -135,6 +135,8 @@ export function createInput(Component: typeof TextInput) { placeholder, value, onChangeText, + onFocus, + onBlur, isInvalid, inputRef, style, @@ -173,8 +175,14 @@ export function createInput(Component: typeof TextInput) { ref={refs} value={value} onChangeText={onChangeText} - onFocus={ctx.onFocus} - onBlur={ctx.onBlur} + onFocus={e => { + ctx.onFocus() + onFocus?.(e) + }} + onBlur={e => { + ctx.onBlur() + onBlur?.(e) + }} placeholder={placeholder || label} placeholderTextColor={t.palette.contrast_500} keyboardAppearance={t.name === 'light' ? 'light' : 'dark'} @@ -188,8 +196,8 @@ export function createInput(Component: typeof TextInput) { a.px_xs, { // paddingVertical doesn't work w/multiline - esb - paddingTop: 14, - paddingBottom: 14, + paddingTop: 12, + paddingBottom: 13, lineHeight: a.text_md.fontSize * 1.1875, textAlignVertical: rest.multiline ? 'top' : undefined, minHeight: rest.multiline ? 80 : undefined, @@ -197,13 +205,14 @@ export function createInput(Component: typeof TextInput) { }, // fix for autofill styles covering border web({ - paddingTop: 12, - paddingBottom: 12, + paddingTop: 10, + paddingBottom: 11, marginTop: 2, marginBottom: 2, }), android({ - paddingBottom: 16, + paddingTop: 8, + paddingBottom: 8, }), style, ]} -- cgit 1.4.1