about summary refs log tree commit diff
path: root/src/components/forms
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2024-09-25 15:54:43 -0500
committerGitHub <noreply@github.com>2024-09-25 15:54:43 -0500
commitb1ca2503de55c41431aac38db4d164da7d506d4f (patch)
treebc9ee42651a4c639d910e6a31572d47fb45c5c93 /src/components/forms
parent6bc001a30e4376e706fd1c10469065e0e78e1bf0 (diff)
downloadvoidsky-b1ca2503de55c41431aac38db4d164da7d506d4f.tar.zst
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
Diffstat (limited to 'src/components/forms')
-rw-r--r--src/components/forms/TextField.tsx23
1 files changed, 16 insertions, 7 deletions
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,
           ]}