The code for the stack is almost the same as v5, with the only differences being the types and the navigation object. To avoid making same changes in 2 places which error-prone, I decided to reuse the same code. Due to the differences, it's not possible to just use it as a dependency, so I followed this approach:
- Copy the source files on post install and apply patches to make it work with React Navigation 4
- When we need to make changes, we can make them in v5 repo and update the version here, most of the time it wouldn't need any extra work
- If we need to make v4 specific changes, we can change the code in vendor/ and then re-generate the patch with `yarn patch`
When user has super short swiping interaction it's an issue that keyboard won't reappear on screen.
That's because there is short time when system will make sure to hide keyboard no matter what. Too fast text input refocus will result only in keyboard flashing on screen and hiding right away.
For such short interactions I created a delay that will ensure that the keyboard will reappear on the screen every time and make sure it's executed only when needed.
It only affect super short interactions <100ms to make sure they work correctly, and doesn't affect any logic beyond that.
As far as my research go it seems that the react-navigation isn't responsible for hiding the Keyboard in that specific case, so I don't think we can simply prevent this action when we don't want it. Doing the check in KeyboardMenager and delaying it is the safest way IMO - we make sure that it won't affect any other logic than concerning keyboard itself. (It would happen if we prevent the action somewhere else like in StackItem)
Tested on physical iOS device, iOS simulator, and Android device with both app using the library and library's example app.