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
* Done as per the text input behaviour from BottomSheetTextInput(https://github.com/gorhom/react-native-bottom-sheet/blob/master/src/components/bottomSheetTextInput/BottomSheetTextInput.tsx)
223
+
* to solve the issue around keyboard hiding the text input in the chat inside bottom sheet.
224
+
* The tip in https://ui.gorhom.dev/components/bottom-sheet/keyboard-handling/ is followed.
225
+
*/
226
+
useEffect(()=>{
227
+
return()=>{
228
+
// Reset the flag on unmount
229
+
shouldHandleKeyboardEvents.value=false;
230
+
};
231
+
},[shouldHandleKeyboardEvents]);
232
+
214
233
return(
215
234
<Viewstyle={styles.chatContainer}>
216
235
<Channel
217
-
// // On Android, the default behaviour is as expected so we do not need to apply the fix to the text input to work with keyboard.
218
-
// additionalTextInputProps={
219
-
// Platform.OS === 'ios'
220
-
// ? {
221
-
// // Done as per https://ui.gorhom.dev/components/bottom-sheet/keyboard-handling/ to solve keyboard hiding the text input in the chat inside bottom sheet.
222
-
// onBlur: () => {
223
-
// shouldHandleKeyboardEvents.value = false;
224
-
// focusOutsideMessageInput();
225
-
// },
226
-
// onFocus: () => {
227
-
// shouldHandleKeyboardEvents.value = true;
228
-
// },
229
-
// }
230
-
// : {}
231
-
// }
236
+
// On Android, the default behaviour is as expected so we do not need to apply the fix to the text input to work with keyboard.
237
+
additionalTextInputProps={
238
+
Platform.OS==='ios'
239
+
? {
240
+
// Done as per https://ui.gorhom.dev/components/bottom-sheet/keyboard-handling/ to solve keyboard hiding the text input in the chat inside bottom sheet.
241
+
onBlur: ()=>{
242
+
shouldHandleKeyboardEvents.value=false;
243
+
focusOutsideMessageInput();
244
+
},
245
+
onFocus: ()=>{
246
+
shouldHandleKeyboardEvents.value=true;
247
+
},
248
+
}
249
+
: {}
250
+
}
232
251
// Hides the sticky date header component on the top of the MessageList
0 commit comments