diff --git a/src/components/DappBrowser/search/Search.tsx b/src/components/DappBrowser/search/Search.tsx index 3ccb413a60b..0f82e4b21fc 100644 --- a/src/components/DappBrowser/search/Search.tsx +++ b/src/components/DappBrowser/search/Search.tsx @@ -2,7 +2,7 @@ import React, { useCallback, useMemo } from 'react'; import { StyleSheet, View } from 'react-native'; import { Gesture, GestureDetector } from 'react-native-gesture-handler'; -import Animated, { dispatchCommand, runOnJS, useAnimatedStyle, withSpring } from 'react-native-reanimated'; +import Animated, { runOnJS, useAnimatedStyle, withSpring } from 'react-native-reanimated'; import { SPRING_CONFIGS } from '@/components/animations/animationConfigs'; import { useColorMode } from '@/design-system'; @@ -121,12 +121,16 @@ export const Search = () => { [goToUrl, inputRef, searchQuery, searchResults] ); + const focusInput = useCallback(() => { + inputRef.current?.focus(); + }, [inputRef]); + const onAddressInputPressWorklet = useCallback(() => { 'worklet'; isFocused.value = true; searchViewProgress.value = withSpring(100, SPRING_CONFIGS.snappierSpringConfig); - dispatchCommand(inputRef, 'focus'); - }, [inputRef, isFocused, searchViewProgress]); + runOnJS(focusInput)(); + }, [focusInput, isFocused, searchViewProgress]); const onBlurWorklet = useCallback(() => { 'worklet';