From 0b1a9cf240296f695a40543502a362e0b585a394 Mon Sep 17 00:00:00 2001 From: Matt Rabe Date: Sat, 24 Jan 2026 09:35:57 -1000 Subject: [PATCH] Clear button for InputSearch --- apps/mobile/src/components/InputSearch.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/mobile/src/components/InputSearch.tsx b/apps/mobile/src/components/InputSearch.tsx index 09e25fb..45088a6 100644 --- a/apps/mobile/src/components/InputSearch.tsx +++ b/apps/mobile/src/components/InputSearch.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useRef } from 'react' -import { StyleSheet, TextInput, View } from 'react-native' +import { StyleSheet, TextInput, TouchableOpacity, View } from 'react-native' import { Ionicons } from '@expo/vector-icons' export function InputSearch({ @@ -38,6 +38,15 @@ export function InputSearch({ autoCorrect={false} testID='search-input' /> + {value.length > 0 && ( + onChangeText('')} + style={styles.clearButton} + testID='clear-button' + > + + + )} ) } @@ -60,4 +69,8 @@ const styles = StyleSheet.create({ paddingLeft: 8, fontSize: 16, }, + clearButton: { + padding: 12, + paddingRight: 12, + }, })