0

I have a TextInput with a clear button (clearButtonMode prop set to 'always'):

       <TextInput
          style={styles.textInputStyle}
          onChangeText={text => this.SearchFilterFunction(text)}
          underlineColorAndroid="transparent"
          placeholder="Search Here"
          clearButtonMode='always'
        />

When the user clears the text field by tapping the clear button, I want to be able to call another function; I've looked through the docs but can't seem to find what I'm looking for (something like an "onClearButtonPressed" prop) -- was wondering if anyone knows a workaround/solution to this?

spitchay
  • 89
  • 1
  • 10

1 Answers1

2

I have meet your problem several times before. I dont think they have support it onPress event yet. My solution is create a custom input component with a custom clear button. Then I can easily add its onPress event of it.

Brian H.
  • 1,603
  • 11
  • 16