[ScrollResponder] keyboard lifecycle events not firing
I am using a ScrollView and trying to invoke scrollResponderScrollNativeHandleToKeyboard but it seems that keyboardWillOpenTo is never set and the keyboard lifecycle events are never invoked. Does something else needs to be done to activate them or is this broken?
@vishnevskiy - did you manage to figure this out or is it still an issue?
I am facing similar problems. 'keyboardWillOpenTo' remains null throughtout the lifetime, preventing the Scroll Responder from calculating the y offset to scroll to. Any updates on how to go about this?
Have you tried using https://github.com/johanneslumpe/react-native-keyboardevents ? This seems to offer the functionality that you require albeit down a different path.
It looks like keyboardWillShow and other events are not firing at all, you could hook into react-native-keyboardevents as @MossP suggests and fire those events on the DeviceEventEmitter to get that to happen. @sahrens was it intentional to not have these fire automatically?
As an aside: this part of React Native -- scrolling to inputs on focus -- definitely needs some work - I've been digging into it recently and hope to have a good general solution for it soon. This is what I put together on a couple of train rides so far: https://gist.github.com/brentvatne/db1cf9fa16f7fbc514cb
@brentvatne still an issue?, lots of events are now in core.
@browniefed - this issue seems related to the ScrollView specific events, I'm not sure if those work or really have ever worked in OSS :O
It looks like RCTDeviceEventEmitter emits different object structures throughout the lifetime of the keyboard opening, but ScrollResponder is ultimately only interested in storing one kind, which holds information like keyboardWillOpenTo.
I made some small changes to ScrollResponder event handlers to filter the events, and now things seem to be working ok. I'll do some more testing and update.
/cc @browniefed @brentvatne @urvashi01
@vishnevskiy @Sherlock92 any updates on this? Are you still seeing issues?
@jsierles actually I can say I'm no longer seeing an issue :)
@Sherlock92 Great - closing this out!