Skip to content

Commit

Permalink
fix: Form summary page , press tab could not go Edit
Browse files Browse the repository at this point in the history
  • Loading branch information
athenachenchen committed Nov 12, 2024
1 parent b069850 commit 84824c7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,17 @@ export const FormStepper = (props: CategorizationStepperLayoutRendererProps): JS
<ReviewItemSection key={index}>
<ReviewItemHeader>
<ReviewItemTitle>{categoryLabel}</ReviewItemTitle>
<Anchor onClick={() => setPage(index + 1)} data-testid={testId}>
<Anchor
tabIndex={readOnly ? -1 : 0}
onClick={() => setPage(index + 1)}
data-testid={testId}
onKeyDown={(e) => {
if (!readOnly && (e.key === ' ' || e.key === 'Enter')) {
e.preventDefault();
setPage(index + 1);
}
}}
>
{readOnly ? 'View' : 'Edit'}
</Anchor>
</ReviewItemHeader>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ export const Anchor = styled.div`
text-decoration: underline;
outline: none;
cursor: pointer;
&:focus {
outline: 2px solid #0070c4;
background-color: #e6f7ff;
}
`;

export const ReviewListItem = styled.div`
Expand Down

0 comments on commit 84824c7

Please sign in to comment.