diff --git a/src/components/Pressable/GenericPressable/BaseGenericPressable.tsx b/src/components/Pressable/GenericPressable/BaseGenericPressable.tsx index 1df56093d6a6..907aa2f8ae01 100644 --- a/src/components/Pressable/GenericPressable/BaseGenericPressable.tsx +++ b/src/components/Pressable/GenericPressable/BaseGenericPressable.tsx @@ -109,20 +109,27 @@ function GenericPressable( if (ref && 'current' in ref) { ref.current?.blur(); } - onPress(event); - + const onPressResult = onPress(event); Accessibility.moveAccessibilityFocus(nextFocusRef); + return onPressResult; }, [shouldUseHapticsOnPress, onPress, nextFocusRef, ref, isDisabled], ); + const onKeyboardShortcutPressHandler = useCallback( + (event?: GestureResponderEvent | KeyboardEvent) => { + onPressHandler(event); + }, + [onPressHandler], + ); + useEffect(() => { if (!keyboardShortcut) { return () => {}; } const {shortcutKey, descriptionKey, modifiers} = keyboardShortcut; - return KeyboardShortcut.subscribe(shortcutKey, onPressHandler, descriptionKey, modifiers, true, false, 0, false); - }, [keyboardShortcut, onPressHandler]); + return KeyboardShortcut.subscribe(shortcutKey, onKeyboardShortcutPressHandler, descriptionKey, modifiers, true, false, 0, false); + }, [keyboardShortcut, onKeyboardShortcutPressHandler]); return (