Closed quadsurf closed 7 years ago
onToggle should be a function you can find a reference here.
This module only displaces the virtual keyboard, keyboard dismissal typically differs between applications and should be handled in your code.
This package may help react-native-dismiss-keyboard.
Closing for inactivity,
If your still having this issue please provide more details and reopen the issue.
Can you give me an example on how to pass a function to onToggle
?
@zhaonian and @quadsurf, here's an example of how to pass a function to onToggle:
handleOnToggle(keyboardState, keyboardSpace) {
// Do whatever you want with keyboardState and keyboardSpace
}
render() {
return <View>
...
<KeyboardSpacer onToggle={this.handleOnToggle} />
...
</View>
}
Everything works great, but when I tap in empty space areas above the keyboard and outside the form (in order to dismiss the keyboard as expected by user), the keyboard does not dismiss. I think I can get the keyboard to dismiss if I can see an example of how to use onToggle.
<KeyboardSpacer onToggle={true} />
or
<KeyboardSpacer onToggle={this.state.toggledStatus} />
neither worked btw