Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix keyboard hiding alt text input after viewing DMs on iOS (#5739)

authored by

Hailey and committed by
GitHub
432dc867 830b4bee

+22 -9
+15
src/components/Dialog/index.tsx
··· 11 11 } from 'react-native' 12 12 import { 13 13 KeyboardAwareScrollView, 14 + useKeyboardController, 14 15 useKeyboardHandler, 15 16 } from 'react-native-keyboard-controller' 16 17 import {runOnJS} from 'react-native-reanimated' ··· 189 190 function ScrollableInner({children, style, ...props}, ref) { 190 191 const {nativeSnapPoint, disableDrag, setDisableDrag} = useDialogContext() 191 192 const insets = useSafeAreaInsets() 193 + const {setEnabled} = useKeyboardController() 194 + 192 195 const [keyboardHeight, setKeyboardHeight] = React.useState(0) 196 + 197 + React.useEffect(() => { 198 + if (!isIOS) { 199 + return 200 + } 201 + 202 + setEnabled(true) 203 + return () => { 204 + setEnabled(false) 205 + } 206 + }) 207 + 193 208 useKeyboardHandler({ 194 209 onEnd: e => { 195 210 'worklet'
+4 -5
src/view/com/composer/GifAltText.tsx
··· 1 1 import React, {useState} from 'react' 2 - import {Dimensions, TouchableOpacity, View} from 'react-native' 2 + import {TouchableOpacity, View} from 'react-native' 3 3 import {msg, Trans} from '@lingui/macro' 4 4 import {useLingui} from '@lingui/react' 5 5 ··· 9 9 EmbedPlayerParams, 10 10 parseEmbedPlayerFromUrl, 11 11 } from '#/lib/strings/embed-player' 12 - import {isAndroid, isWeb} from '#/platform/detection' 12 + import {isAndroid} from '#/platform/detection' 13 13 import {useResolveGifQuery} from '#/state/queries/resolve-link' 14 14 import {Gif} from '#/state/queries/tenor' 15 15 import {AltTextCounterWrapper} from '#/view/com/composer/AltTextCounterWrapper' ··· 107 107 control={control} 108 108 onClose={() => { 109 109 onSubmit(altTextDraft) 110 - }} 111 - nativeOptions={{minHeight: Dimensions.get('window').height}}> 110 + }}> 112 111 <Dialog.Handle /> 113 112 <AltTextInner 114 113 vendorAltText={vendorAltText} ··· 158 157 defaultValue={altText} 159 158 multiline 160 159 numberOfLines={3} 161 - autoFocus={isWeb} 160 + autoFocus 162 161 onKeyPress={({nativeEvent}) => { 163 162 if (nativeEvent.key === 'Escape') { 164 163 control.close()
+3 -4
src/view/com/composer/photos/ImageAltTextDialog.tsx
··· 1 1 import React from 'react' 2 - import {Dimensions, ImageStyle, useWindowDimensions, View} from 'react-native' 2 + import {ImageStyle, useWindowDimensions, View} from 'react-native' 3 3 import {Image} from 'expo-image' 4 4 import {msg, Trans} from '@lingui/macro' 5 5 import {useLingui} from '@lingui/react' ··· 38 38 ...image, 39 39 alt: enforceLen(altText, MAX_ALT_TEXT, true), 40 40 }) 41 - }} 42 - nativeOptions={{minHeight: Dimensions.get('window').height}}> 41 + }}> 43 42 <Dialog.Handle /> 44 43 <ImageAltTextInner 45 44 control={control} ··· 123 122 defaultValue={altText} 124 123 multiline 125 124 numberOfLines={3} 126 - autoFocus={isWeb} 125 + autoFocus 127 126 /> 128 127 </TextField.Root> 129 128 </View>