feat(base-chat): conditioned should set responder
This commit is contained in:
parent
06491e2406
commit
4ef88aa90e
|
@ -34,6 +34,11 @@ type Props = {
|
|||
*/
|
||||
hasTabNavigator: boolean,
|
||||
|
||||
/**
|
||||
* Is the keyboard already dismissible?
|
||||
*/
|
||||
keyboardAlreadyDismissible?: boolean,
|
||||
|
||||
/**
|
||||
* Additional style to be appended to the KeyboardAvoidingView.
|
||||
*/
|
||||
|
@ -46,6 +51,7 @@ const JitsiKeyboardAvoidingView = (
|
|||
contentContainerStyle,
|
||||
hasTabNavigator,
|
||||
hasBottomTextInput,
|
||||
keyboardAlreadyDismissible,
|
||||
style
|
||||
}: Props) => {
|
||||
const headerHeight = useHeaderHeight();
|
||||
|
@ -68,7 +74,7 @@ const JitsiKeyboardAvoidingView = (
|
|||
? headerHeight + StatusBar.currentHeight : headerHeight;
|
||||
|
||||
// Tells the view what to do with taps
|
||||
const shouldSetResponse = useCallback(() => true);
|
||||
const shouldSetResponse = useCallback(() => !keyboardAlreadyDismissible);
|
||||
const onRelease = useCallback(() => Keyboard.dismiss());
|
||||
|
||||
return (
|
||||
|
|
|
@ -37,6 +37,11 @@ type Props = {
|
|||
*/
|
||||
hasTabNavigator?: boolean,
|
||||
|
||||
/**
|
||||
* Is the keyboard already dismissible?
|
||||
*/
|
||||
keyboardAlreadyDismissible?: boolean,
|
||||
|
||||
/**
|
||||
* Insets for the SafeAreaView.
|
||||
*/
|
||||
|
@ -54,6 +59,7 @@ const JitsiScreen = ({
|
|||
footerComponent,
|
||||
hasTabNavigator = false,
|
||||
hasBottomTextInput = false,
|
||||
keyboardAlreadyDismissible = false,
|
||||
safeAreaInsets = [ 'left', 'right' ],
|
||||
style
|
||||
}: Props) => (
|
||||
|
@ -63,13 +69,14 @@ const JitsiScreen = ({
|
|||
contentContainerStyle = { contentContainerStyle }
|
||||
hasBottomTextInput = { hasBottomTextInput }
|
||||
hasTabNavigator = { hasTabNavigator }
|
||||
keyboardAlreadyDismissible = { keyboardAlreadyDismissible }
|
||||
style = { style }>
|
||||
<SafeAreaView
|
||||
edges = { safeAreaInsets }
|
||||
style = { styles.safeArea }>
|
||||
{children}
|
||||
</SafeAreaView>
|
||||
{footerComponent && footerComponent()}
|
||||
{ footerComponent && footerComponent() }
|
||||
</JitsiKeyboardAvoidingView>
|
||||
</View>
|
||||
);
|
||||
|
|
|
@ -55,6 +55,7 @@ class Chat extends AbstractChat<Props> {
|
|||
<JitsiScreen
|
||||
hasBottomTextInput = { true }
|
||||
hasTabNavigator = { true }
|
||||
keyboardAlreadyDismissible = { true }
|
||||
style = { styles.chatContainer }>
|
||||
<MessageContainer messages = { _messages } />
|
||||
<MessageRecipient privateMessageRecipient = { privateMessageRecipient } />
|
||||
|
|
Loading…
Reference in New Issue