Merge remote-tracking branch 'origin/main' into next/embeds

* origin/main:
  new arch (#8295)
  Nightly source-language update
  Loosen post source constraints (#8478)
  hide keyboard when backgrounding (#8450)
This commit is contained in:
Eric Bailey
2025-06-12 13:10:23 -05:00
34 changed files with 1293 additions and 1069 deletions
+15
View File
@@ -64,6 +64,7 @@ import {
type SupportedMimeTypes,
} from '#/lib/constants'
import {useAnimatedScrollHandler} from '#/lib/hooks/useAnimatedScrollHandler_FIXED'
import {useAppState} from '#/lib/hooks/useAppState'
import {useIsKeyboardVisible} from '#/lib/hooks/useIsKeyboardVisible'
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
import {usePalette} from '#/lib/hooks/usePalette'
@@ -823,6 +824,8 @@ let ComposerPost = React.memo(function ComposerPost({
[post.id, onSelectVideo, onImageAdd, _],
)
useHideKeyboardOnBackground()
return (
<View
style={[
@@ -1527,6 +1530,18 @@ function isEmptyPost(post: PostDraft) {
)
}
function useHideKeyboardOnBackground() {
const appState = useAppState()
useEffect(() => {
if (isIOS) {
if (appState === 'inactive') {
Keyboard.dismiss()
}
}
}, [appState])
}
const styles = StyleSheet.create({
topbarInner: {
flexDirection: 'row',
@@ -16,7 +16,7 @@ import {
import {AppBskyRichtextFacet, RichText} from '@atproto/api'
import PasteInput, {
type PastedFile,
type PasteInputRef,
type PasteInputRef, // @ts-expect-error no types when installing from github
} from '@mattermost/react-native-paste-input'
import {POST_IMG_MAX} from '#/lib/constants'