react-native-keyboard-aware-scroll-view icon indicating copy to clipboard operation
react-native-keyboard-aware-scroll-view copied to clipboard

KeyboardAwareMixin won't register keyboard events callback

Open leonardocarvalho opened this issue 9 years ago • 3 comments

I see from the docs that one should be able to register callbacks passing onKeyboardWillShow, for example. But that doesn't seem to be actually happening. Am I missing something?

I expected a code like:

componentDidMount: function () {
  // current code here
  // Similar (maybe cleverer) code for each supported event
  if (this.props.onKeyboardWillShow) {
    this.keyboardShowCallbackEvent = Keyboard.addListener('keyboardWillShow', this.props.onKeyboardWillShow);
  }                                                                                                     
},

componentWillUnmount: function () {
  // current code here
  // Similar (maybe cleverer) code for each supported event
  this.keyboardShowCallbackEvent && this.keyboardShowCallbackEvent.remove();
},

On KeyboardAwareMixin

leonardocarvalho avatar Aug 29 '17 13:08 leonardocarvalho

You are right, onKeyboardWillShow prop isn't handled yet.

@alvaromb I see that you are rewriting the component, could you handle it in the new implementation?

Swordsman-Inaction avatar Oct 08 '17 06:10 Swordsman-Inaction

Hi @leonardocarvalho!

Can you send us a PR? :)

alvaromb avatar Oct 24 '17 10:10 alvaromb

So are the docs incorrect; onKeyboardWillShow is ignored?

I am having the same issue.

v0.2.9

crazy4groovy avatar Nov 16 '17 17:11 crazy4groovy