call onClearText
This commit is contained in:
@@ -18,7 +18,10 @@ type SearchInputProps = Omit<TextField.InputProps, 'label'> & {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const SearchInput = React.forwardRef<TextInput, SearchInputProps>(
|
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 t = useTheme()
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
const [showClear, setShowClear] = useState(false)
|
const [showClear, setShowClear] = useState(false)
|
||||||
@@ -33,6 +36,7 @@ export const SearchInput = React.forwardRef<TextInput, SearchInputProps>(
|
|||||||
inputRef.current?.clear()
|
inputRef.current?.clear()
|
||||||
setShowClear(false)
|
setShowClear(false)
|
||||||
onChangeTextProp?.('')
|
onChangeTextProp?.('')
|
||||||
|
onClearText?.()
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user