Skip to content

Commit

Permalink
Merge pull request #37182 from agent3bood/issue/36520-Android---Scan-…
Browse files Browse the repository at this point in the history
…--Second-tap-on-capture-button-causes-error-to-show-up

Issue/36520 android scan second tap on capture button causes error to show up
  • Loading branch information
techievivek authored Feb 29, 2024
2 parents 04c8305 + 1a12f49 commit 104565b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions src/components/Pressable/GenericPressable/BaseGenericPressable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<Pressable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ function IOURequestStepScan({
return;
}

camera.current
return camera.current
.takePhoto({
qualityPrioritization: 'speed',
flash: flash ? 'on' : 'off',
Expand Down

0 comments on commit 104565b

Please sign in to comment.