Skip to content

Commit

Permalink
Merge pull request Expensify#35154 from s-alves10/fix/issue-26326
Browse files Browse the repository at this point in the history
fix: disable tab key event in Money Request page
  • Loading branch information
cristipaval authored Jan 29, 2024
2 parents 3d46b00 + d1a00a2 commit 6ef50fb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/pages/iou/request/IOURequestStartPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import usePrevious from '@hooks/usePrevious';
import useThemeStyles from '@hooks/useThemeStyles';
import * as DeviceCapabilities from '@libs/DeviceCapabilities';
import * as IOUUtils from '@libs/IOUUtils';
import * as KeyDownPressListener from '@libs/KeyboardShortcut/KeyDownPressListener';
import Navigation from '@libs/Navigation/Navigation';
import OnyxTabNavigator, {TopTab} from '@libs/Navigation/OnyxTabNavigator';
import * as ReportUtils from '@libs/ReportUtils';
Expand Down Expand Up @@ -87,6 +88,19 @@ function IOURequestStartPage({
[reportID],
);

useEffect(() => {
const handler = (event) => {
if (event.code !== CONST.KEYBOARD_SHORTCUTS.TAB.shortcutKey) {
return;
}
event.preventDefault();
event.stopPropagation();
};
KeyDownPressListener.addKeyDownPressListener(handler);

return () => KeyDownPressListener.removeKeyDownPressListener(handler);
}, []);

// Clear out the temporary money request if the reportID in the URL has changed from the transaction's reportID
useEffect(() => {
if (transaction.reportID === reportID) {
Expand Down

0 comments on commit 6ef50fb

Please sign in to comment.