Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions src/components/Form/FormWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import useBottomSafeSafeAreaPaddingStyle from '@hooks/useBottomSafeSafeAreaPaddi
import useOnyx from '@hooks/useOnyx';
import useSafeAreaPaddings from '@hooks/useSafeAreaPaddings';
import useThemeStyles from '@hooks/useThemeStyles';
import Accessibility from '@libs/Accessibility';
import {getLatestErrorMessage} from '@libs/ErrorUtils';
import CONST from '@src/CONST';
import type {OnyxFormKey} from '@src/ONYXKEYS';
Expand Down Expand Up @@ -135,17 +134,8 @@ function FormWrapper({
);
}

// We use InteractionManager to ensure the accessibility focus happens after the scroll animation completes
// eslint-disable-next-line @typescript-eslint/no-deprecated
InteractionManager.runAfterInteractions(() => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
const nativeRef = (focusInput as any)?.getNativeRef?.() ?? focusInput;
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
Accessibility.moveAccessibilityFocus(nativeRef);

// Focus the input after moving accessibility focus
focusInput?.focus?.();
});
// Focus the input after scrolling, as on the Web it gives a slightly better visual result
focusInput?.focus?.();
Comment on lines +137 to +138

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore accessibility focus transfer on "Fix the errors"

This revert removes the Accessibility.moveAccessibilityFocus(...) call from onFixTheErrorsLinkPressed, so activating the “Fix the errors” link now only does focusInput?.focus?.(); on native screen readers (VoiceOver/TalkBack), that can leave the accessibility cursor on the link instead of moving/announcing the invalid field. Because moveAccessibilityFocus is the path that sends a native accessibility focus event, removing it regresses keyboard/screen-reader navigation for users who rely on that link to jump to form errors.

Useful? React with 👍 / 👎.

};

// If either of `addBottomSafeAreaPadding` or `shouldSubmitButtonStickToBottom` is explicitly set,
Expand Down
Loading