Skip to content

Commit 10d934c

Browse files
authored
fix: keyboard taking full screen issue when the prefer cross-fade transition setting is enabled (#3073)
* fix: respect the hasCommand channel prop as well * fix: keybaord taking full screen issue when the prefer cross-fade transition setting is enabled (#3072) * fix: keybaord taking full screen issue when the prefer cross-fade transition setting is enabled
1 parent 75117d5 commit 10d934c

File tree

5 files changed

+14
-57
lines changed

5 files changed

+14
-57
lines changed

examples/SampleApp/yarn.lock

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7559,25 +7559,6 @@ statuses@~1.5.0:
75597559
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
75607560
integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==
75617561

7562-
7563-
version "6.7.3"
7564-
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.7.3.tgz#7e213c03a7414c85ec4ba9da247d9703878ab520"
7565-
integrity sha512-dYoYkVah7l4bmkI0vl7Ma6qD+xjsmeFWOdz7EVwbtR+B3HPMsgz8eRAmBj/p2xcSANxh1bPRD0iLlvD30vXyzg==
7566-
dependencies:
7567-
"@gorhom/bottom-sheet" "^5.1.1"
7568-
dayjs "1.10.5"
7569-
emoji-regex "^10.3.0"
7570-
i18next "^21.6.14"
7571-
intl-pluralrules "^2.0.1"
7572-
linkifyjs "^4.1.1"
7573-
lodash-es "4.17.21"
7574-
mime-types "^2.1.34"
7575-
path "0.12.7"
7576-
react-native-markdown-package "1.8.2"
7577-
react-native-url-polyfill "^1.3.0"
7578-
stream-chat "^8.57.6"
7579-
use-sync-external-store "^1.4.0"
7580-
75817562
"stream-chat-react-native-core@link:../../package":
75827563
version "0.0.0"
75837564
uid ""

package/expo-package/yarn.lock

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4780,24 +4780,9 @@ [email protected], stream-buffers@~2.2.0:
47804780
resolved "https://registry.yarnpkg.com/stream-buffers/-/stream-buffers-2.2.0.tgz#91d5f5130d1cef96dcfa7f726945188741d09ee4"
47814781
integrity sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg==
47824782

4783-
4784-
version "6.7.3"
4785-
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.7.3.tgz#7e213c03a7414c85ec4ba9da247d9703878ab520"
4786-
integrity sha512-dYoYkVah7l4bmkI0vl7Ma6qD+xjsmeFWOdz7EVwbtR+B3HPMsgz8eRAmBj/p2xcSANxh1bPRD0iLlvD30vXyzg==
4787-
dependencies:
4788-
"@gorhom/bottom-sheet" "^5.1.1"
4789-
dayjs "1.10.5"
4790-
emoji-regex "^10.3.0"
4791-
i18next "^21.6.14"
4792-
intl-pluralrules "^2.0.1"
4793-
linkifyjs "^4.1.1"
4794-
lodash-es "4.17.21"
4795-
mime-types "^2.1.34"
4796-
path "0.12.7"
4797-
react-native-markdown-package "1.8.2"
4798-
react-native-url-polyfill "^1.3.0"
4799-
stream-chat "^8.57.6"
4800-
use-sync-external-store "^1.4.0"
4783+
"stream-chat-react-native-core@link:..":
4784+
version "0.0.0"
4785+
uid ""
48014786

48024787
stream-chat@^8.57.6:
48034788
version "8.60.0"

package/native-package/yarn.lock

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3496,24 +3496,9 @@ statuses@~1.5.0:
34963496
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
34973497
integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==
34983498

3499-
3500-
version "6.7.3"
3501-
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.7.3.tgz#7e213c03a7414c85ec4ba9da247d9703878ab520"
3502-
integrity sha512-dYoYkVah7l4bmkI0vl7Ma6qD+xjsmeFWOdz7EVwbtR+B3HPMsgz8eRAmBj/p2xcSANxh1bPRD0iLlvD30vXyzg==
3503-
dependencies:
3504-
"@gorhom/bottom-sheet" "^5.1.1"
3505-
dayjs "1.10.5"
3506-
emoji-regex "^10.3.0"
3507-
i18next "^21.6.14"
3508-
intl-pluralrules "^2.0.1"
3509-
linkifyjs "^4.1.1"
3510-
lodash-es "4.17.21"
3511-
mime-types "^2.1.34"
3512-
path "0.12.7"
3513-
react-native-markdown-package "1.8.2"
3514-
react-native-url-polyfill "^1.3.0"
3515-
stream-chat "^8.57.6"
3516-
use-sync-external-store "^1.4.0"
3499+
"stream-chat-react-native-core@link:..":
3500+
version "0.0.0"
3501+
uid ""
35173502

35183503
stream-chat@^8.57.6:
35193504
version "8.60.0"

package/src/components/Channel/Channel.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,7 @@ const ChannelWithContext = (props: PropsWithChildren<ChannelPropsWithContext>) =
553553
handleRetry,
554554
handleThreadReply,
555555
hasCameraPicker = isImagePickerAvailable(),
556+
hasCommands,
556557
hasCreatePoll,
557558
// If pickDocument isn't available, default to hiding the file picker
558559
hasFilePicker = isDocumentPickerAvailable(),
@@ -1809,7 +1810,7 @@ const ChannelWithContext = (props: PropsWithChildren<ChannelPropsWithContext>) =
18091810
FileUploadPreview,
18101811
handleAttachButtonPress,
18111812
hasCameraPicker,
1812-
hasCommands: (getChannelConfigSafely()?.commands ?? []).length > 0,
1813+
hasCommands: hasCommands ?? (getChannelConfigSafely()?.commands ?? []).length > 0,
18131814
hasFilePicker,
18141815
hasImagePicker,
18151816
ImageUploadPreview,

package/src/components/KeyboardCompatibleView/KeyboardCompatibleView.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,12 @@ export class KeyboardCompatibleView extends React.Component<
5858

5959
_relativeKeyboardHeight(keyboardFrame: KeyboardMetrics) {
6060
const frame = this._frame;
61-
if (!frame || !keyboardFrame) {
61+
/**
62+
* With iOS 14 & Reduce Motion > Prefer Cross-Fade Transitions enabled, the keyboard position
63+
* height is reported differently (0 instead of Y position value) which caused the view to take full height
64+
* of the screen.
65+
*/
66+
if (!frame || !keyboardFrame || keyboardFrame.screenY === 0) {
6267
return 0;
6368
}
6469

0 commit comments

Comments
 (0)