Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

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

[iOS] Fix selecting search input on focus (#3746)

* Select search text on focus

* Scope to iOS only

authored by

dan and committed by
GitHub
dfce190c 361d255e

+8 -2
+8 -2
src/view/screens/Search/Search.tsx
··· 25 25 import {augmentSearchQuery} from '#/lib/strings/helpers' 26 26 import {s} from '#/lib/styles' 27 27 import {logger} from '#/logger' 28 - import {isNative, isWeb} from '#/platform/detection' 28 + import {isIOS, isNative, isWeb} from '#/platform/detection' 29 29 import {listenSoftReset} from '#/state/events' 30 30 import {useActorAutocompleteQuery} from '#/state/queries/actor-autocomplete' 31 31 import {useActorSearch} from '#/state/queries/actor-search' ··· 670 670 ref={textInput} 671 671 placeholder={_(msg`Search`)} 672 672 placeholderTextColor={pal.colors.textLight} 673 - selectTextOnFocus={isNative} 674 673 returnKeyType="search" 675 674 value={searchText} 676 675 style={[pal.text, styles.headerSearchInput]} 677 676 keyboardAppearance={theme.colorScheme} 677 + selectTextOnFocus={isNative} 678 678 onFocus={() => { 679 679 if (isWeb) { 680 680 // Prevent a jump on iPad by ensuring that ··· 684 684 }) 685 685 } else { 686 686 setShowAutocomplete(true) 687 + if (isIOS) { 688 + // We rely on selectTextOnFocus, but it's broken on iOS: 689 + // https://github.com/facebook/react-native/issues/41988 690 + textInput.current?.setSelection(0, searchText.length) 691 + // We still rely on selectTextOnFocus for it to be instant on Android. 692 + } 687 693 } 688 694 }} 689 695 onChangeText={onChangeText}