Explain what you did (Required)
I am building a search bar for my app. On ios, hiding the keyboard works as expected, but on android hiding the keyboard hides the search results.
Expected behavior (Required)
I should be able to dismiss keyboard on android without also triggering the cancel function.
Describe the bug (Required)
On android, this is the function: (SearchBar-android.tsx 102-108)
Keyboard.addListener('keyboardDidHide', this._keyboardDidHide);
}
_keyboardDidHide = () => {
this.cancel();
};
componentWillUnmount() {
Keyboard.removeListener('keyboardDidHide', this._keyboardDidHide);
}
You see, as soon as I hide the keyboard, the cancel function is executed. The same function is also executed on Canceling the search via the back button on android. This is breaking a lot of things for me, when I want users to see the search results by dismissing the keyboard.
To Reproduce (Required)
- Display a search bar.
- Write an onCancel function. iN the function, write this: "console.log("in cancel function")
- test on your android phone. Type something, and then press enter/ok etc on your keyboard to dismiss the keyboard.
- See if the cancel function is executed.
- Do the same on iOS. See if the cancel function is executed.
Screenshots (Required)
Not applicable.
Your Environment (Required):
| software |
version |
| react-native-elements |
3.4.2 |
| react-native |
0.63.4 |
Explain what you did (Required)
I am building a search bar for my app. On ios, hiding the keyboard works as expected, but on android hiding the keyboard hides the search results.
Expected behavior (Required)
I should be able to dismiss keyboard on android without also triggering the cancel function.
Describe the bug (Required)
On android, this is the function: (SearchBar-android.tsx 102-108)
You see, as soon as I hide the keyboard, the cancel function is executed. The same function is also executed on Canceling the search via the back button on android. This is breaking a lot of things for me, when I want users to see the search results by dismissing the keyboard.
To Reproduce (Required)
Screenshots (Required)
Not applicable.
Your Environment (Required):