Fix media query used to prevent enter sending DM on mobile web (#6669)

This commit is contained in:
Bas van den Wollenberg
2024-11-23 21:11:13 +01:00
committed by GitHub
parent 9663b3e855
commit b892d8be08
@@ -38,7 +38,7 @@ export function MessageInput({
children?: React.ReactNode children?: React.ReactNode
openEmojiPicker?: (pos: EmojiPickerPosition) => void openEmojiPicker?: (pos: EmojiPickerPosition) => void
}) { }) {
const {isTabletOrDesktop} = useWebMediaQueries() const {isMobile} = useWebMediaQueries()
const {_} = useLingui() const {_} = useLingui()
const t = useTheme() const t = useTheme()
const {getDraft, clearDraft} = useMessageDraft() const {getDraft, clearDraft} = useMessageDraft()
@@ -212,7 +212,7 @@ export function MessageInput({
onChange={onChange} onChange={onChange}
// On mobile web phones, we want to keep the same behavior as the native app. Do not submit the message // On mobile web phones, we want to keep the same behavior as the native app. Do not submit the message
// in these cases. // in these cases.
onKeyDown={isTouchDevice && isTabletOrDesktop ? undefined : onKeyDown} onKeyDown={isTouchDevice && isMobile ? undefined : onKeyDown}
/> />
<Pressable <Pressable
accessibilityRole="button" accessibilityRole="button"