react-native-easy-toast icon indicating copy to clipboard operation
react-native-easy-toast copied to clipboard

Keyboard open

Open guitar9 opened this issue 7 years ago • 7 comments

When keyboard is open the toast is behind the keyboard. it should be over the keyboard

guitar9 avatar Mar 17 '18 20:03 guitar9

同问

yogu2017 avatar Mar 21 '18 06:03 yogu2017

I also want to know how to solve it.

ghost avatar Jul 16 '18 10:07 ghost

any fixes?

saeedvz avatar Nov 02 '18 07:11 saeedvz

here: add setKeyboardHeight function in index.js

setKeyboardHeight(h) {
    this.keyboardHeight = h
 }

in render()

 case 'bottom':
        pos = height - this.props.positionValue - this.keyboardHeight

handle keyboard show/hide in your component

componentDidMount() {  
    this.keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', this._keyboardDidShow)
    this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this._keyboardDidHide)
  }
  componentWillUnmount() { 
    this.keyboardDidShowListener.remove()
    this.keyboardDidHideListener.remove()
  }
 _keyboardDidShow (e) {
    this.toast.setKeyboardHeight(e.endCoordinates.height)
  }
  _keyboardDidHide () {
    this.toast.setKeyboardHeight(0)
  }

this.toast = ref

  <Toast ref={(ref) => { this.toast = ref }} />

hope helps!

z98361 avatar Dec 01 '18 08:12 z98361

any fixes?

kevin871223 avatar Feb 20 '19 14:02 kevin871223

Depending on your usecase, you could wrap the screen in KeyboardAvoidingView

sesm avatar Mar 15 '19 09:03 sesm

Any correction? I'm using KeyboardAvoidingView along with ScrollView and the message does not appear over the keyboard.

Serginh0 avatar Mar 19 '19 12:03 Serginh0