You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Expensify app keyboard handling is not consistent across iOS/Android platforms:
on Android we mostly rely on default keyboard avoiding mechanism adjustResize (it works great, but lacks of synchronous animations - which means the screen will be instantly resized, and there will be no animation at all. For chat-like apps this is quite important to have for good UX)
since Android handles it automatically - it's very hard to add any customization to keyboard handling (for example to preserve elements position which are obscured by keyboard)
on iOS we are using JS code mixture to handle keyboard avoidance (KeyboardAvoidingView, subscriptions to keyboard events)
since iOS keyboard handling is done in JS code, on Android we use native keyboard avoidance provided by OS and we are writing cross-platform code -> we have a lot of Platform dependent code (like enabling KeyboardAvoidingView only on iOS), which eventually leads to UI inconsistency
react-native offers a limited API for keyboard handling (especially on Android, where we can detect only Did events)
react-native API is far behind from modern ways of keyboard handling
edge-to-edge mode -> identical work with insets on both platforms
disabled default keyboard handling - all keyboard handling is delegated to developer providing basics primitives
consistent API for working with the keyboard (all events are available on both platforms, including Will events which were not available prior to RN API)
interactive keyboard support - an ability to dismiss keyboard via gesture (default RN implementation only works on iOS and has severe limitations, such as multiline TextInput can not grow)
Migration plan
I see next potential way for improving keyboard handling (aka migration plan):
start to use this library on chat screen on Android (this library also will give a smooth transition on chat screen when keyboard appears/disappears, so UI will look better & more pleasant for end user) (feat: remove KeyboardAvoidingView compat layer #54101)
search screen:
right now "footer" (invite a friend, get 250$) has an instant transition and doesn't follow keyboard movement - with this library transition will be smooth (KeyboardStickyFooter component) (feat: remove KeyboardAvoidingView compat layer #54101)
See it in action
on Android when keyboard appears -> at the bottom of the screen we have a different color (under keyboard) - that's how default keyboard avoidance works in Android - when we'll have a frame-level control we can fix it as well and we'll not see any blinks there (feat: remove KeyboardAvoidingView compat layer #54101)
@roryabraham wanted to replace useKeyboardContext with this new library
In Profile->Address screen: auto scroll is waiting for keyboardDidShow event and we have kind of two-fold animation -> potentially can be fixed by KeyboardAwareScrollView with fully synchronized animations
Problem statement
In Expensify app keyboard handling is not consistent across iOS/Android platforms:
adjustResize(it works great, but lacks of synchronous animations - which means the screen will be instantly resized, and there will be no animation at all. For chat-like apps this is quite important to have for good UX)KeyboardAvoidingView, subscriptions to keyboard events)since iOS keyboard handling is done in JS code, on Android we use native keyboard avoidance provided by OS and we are writing cross-platform code -> we have a lot of Platform dependent code (like enabling
KeyboardAvoidingViewonly on iOS), which eventually leads to UI inconsistencyDidevents)With
react-native-keyboard-controller:Willevents which were not available prior to RN API)multilineTextInput can not grow)Migration plan
I see next potential way for improving keyboard handling (aka migration plan):
implement inline auto suggestions (Inline auto suggestion #42630)start to use it on a chat screen on iOS only (fix: messages content overlap when bottom sheet is shown #54764)start to use this library on chat screen on Android (this library also will give a smooth transition on chat screen when keyboard appears/disappears, so UI will look better & more pleasant for end user) (feat: removeKeyboardAvoidingViewcompat layer #54101)search screen:right now "footer" (invite a friend, get 250$) has an instant transition and doesn't follow keyboard movement - with this library transition will be smooth (KeyboardStickyFootercomponent) (feat: removeKeyboardAvoidingViewcompat layer #54101)See it in action
on Android when keyboard appears -> at the bottom of the screen we have a different color (under keyboard) - that's how default keyboard avoidance works in Android - when we'll have a frame-level control we can fix it as well and we'll not see any blinks there (feat: removeKeyboardAvoidingViewcompat layer #54101)See it in action
on Chat screen we can add "interactive keyboard dismissal" (when keyboard can be closed via gesture) - Improve the composer swipe down closing logic #54270@roryabraham wanted to replaceuseKeyboardContextwith this new libraryIn Profile->Address screen: auto scroll is waiting for
keyboardDidShowevent and we have kind of two-fold animation -> potentially can be fixed by KeyboardAwareScrollView with fully synchronized animationsAdditional resources
Upwork Automation - Do Not Edit