call onClearText

This commit is contained in:
Samuel Newman
2024-10-09 07:34:22 +03:00
parent 130edab331
commit 1697c0b50c
+5 -1
View File
@@ -18,7 +18,10 @@ type SearchInputProps = Omit<TextField.InputProps, 'label'> & {
}
export const SearchInput = React.forwardRef<TextInput, SearchInputProps>(
function SearchInput({label, onChangeText: onChangeTextProp, ...rest}, ref) {
function SearchInput(
{label, onChangeText: onChangeTextProp, onClearText, ...rest},
ref,
) {
const t = useTheme()
const {_} = useLingui()
const [showClear, setShowClear] = useState(false)
@@ -33,6 +36,7 @@ export const SearchInput = React.forwardRef<TextInput, SearchInputProps>(
inputRef.current?.clear()
setShowClear(false)
onChangeTextProp?.('')
onClearText?.()
}
return (