Skip to content

Commit e08607a

Browse files
Small keyboard related fixes
1 parent 83590a3 commit e08607a

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

src/components/ChannelInner.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ class ChannelInner extends PureComponent {
706706
);
707707
}
708708

709-
return <View>{core}</View>;
709+
return <View style={{ height: '100%' }}>{core}</View>;
710710
}
711711
}
712712

src/components/KeyboardCompatibleView.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,13 @@ export class KeyboardCompatibleView extends React.PureComponent {
278278
animatedViewProps.onLayout = this.onLayout;
279279
}
280280

281+
if (!this.props.enabled) {
282+
return (
283+
<KeyboardContext.Provider value={this.getContext()}>
284+
{this.props.children}
285+
</KeyboardContext.Provider>
286+
);
287+
}
281288
return (
282289
<Animated.View {...animatedViewProps}>
283290
<KeyboardContext.Provider value={this.getContext()}>

src/context.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
2+
import { Keyboard } from 'react-native';
33
export const ChatContext = React.createContext({ client: null });
44

55
export function withChatContext(OriginalComponent) {
@@ -44,7 +44,9 @@ export function withMessageContentContext(OriginalComponent) {
4444
return getContextAwareComponent(MessageContentContext, OriginalComponent);
4545
}
4646

47-
export const KeyboardContext = React.createContext({});
47+
export const KeyboardContext = React.createContext({
48+
dismissKeyboard: Keyboard.dismiss,
49+
});
4850

4951
export function withKeyboardContext(OriginalComponent) {
5052
return getContextAwareComponent(KeyboardContext, OriginalComponent);

0 commit comments

Comments
 (0)