File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,9 @@ import {
2020import { useTranslatedMessage } from '../../../hooks/useTranslatedMessage' ;
2121import { NativeHandlers } from '../../../native' ;
2222
23- const useWithPortalKeyboardSafety = < T extends unknown [ ] > ( callback : ( ...args : T ) => void ) => {
23+ export const useWithPortalKeyboardSafety = < T extends unknown [ ] > (
24+ callback : ( ...args : T ) => void ,
25+ ) => {
2426 const callbackAfterKeyboardOpen = useAfterKeyboardOpenCallback ( callback ) ;
2527
2628 return usePortalSettledCallback ( callbackAfterKeyboardOpen ) ;
Original file line number Diff line number Diff line change 11import { useEffect , useRef } from 'react' ;
22import { EventSubscription , Keyboard , Platform } from 'react-native' ;
33
4- import { useKeyboardVisibility } from './useKeyboardVisibility' ;
5-
64import { useStableCallback } from './useStableCallback' ;
75
86import { KeyboardControllerPackage } from '../components/KeyboardCompatibleView/KeyboardControllerAvoidingView' ;
@@ -18,7 +16,6 @@ import { useMessageInputContext } from '../contexts/messageInputContext/MessageI
1816export const useAfterKeyboardOpenCallback = < T extends unknown [ ] > (
1917 callback : ( ...args : T ) => void ,
2018) => {
21- const isKeyboardVisible = useKeyboardVisibility ( ) ;
2219 const { inputBoxRef } = useMessageInputContext ( ) ;
2320 const keyboardSubscriptionRef = useRef < EventSubscription | undefined > ( undefined ) ;
2421 // This callback runs from a keyboard event listener, so it must stay fresh across rerenders.
@@ -45,7 +42,7 @@ export const useAfterKeyboardOpenCallback = <T extends unknown[]>(
4542 return ;
4643 }
4744
48- if ( isKeyboardVisible ) {
45+ if ( Keyboard . isVisible ( ) ) {
4946 inputBoxRef . current . focus ( ) ;
5047 runCallback ( ) ;
5148 return ;
You can’t perform that action at this time.
0 commit comments