Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a11y for contacts page - PN-12920 #1369

Closed
wants to merge 5 commits into from
Closed

Fix a11y for contacts page - PN-12920 #1369

wants to merge 5 commits into from

Conversation

leleOFA
Copy link
Contributor

@leleOFA leleOFA commented Oct 23, 2024

Short description

fix a11y in ContactSummaryCard and TitleBoxComponent of contacts page for windows assistent

List of changes proposed in this pull request

  • insert aria label in Title
  • delete aria hidden iin card

How to test

with voiceOver/ Narrator navigate in previous component cited

@@ -50,6 +50,7 @@ const TitleBox: React.FC<Props> = ({
variant={variantTitle}
display="inline-block"
sx={{ verticalAlign: 'middle' }}
aria-label={`${title}-page`}
Copy link
Contributor

Choose a reason for hiding this comment

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

aria-labels on typography are wrongs, because the screen reader reads the text twice. Maybe the problem is on the typography variant

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in the windows os screen reader not read without that

Copy link
Contributor

Choose a reason for hiding this comment

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

mmm it is not the correct way to fix the bug

Copy link
Contributor Author

@leleOFA leleOFA Nov 7, 2024

Choose a reason for hiding this comment

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

which is?

Copy link
Contributor

Choose a reason for hiding this comment

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

try on your own

{getIcon()}
<Typography
variant="body2"
fontWeight={600}
data-testid="cardTitle"
aria-hidden
Copy link
Contributor

Choose a reason for hiding this comment

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

this should not be removed. why did you remove it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

on windows the card are not read

Copy link
Contributor

Choose a reason for hiding this comment

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

I tried with windows and also with aria-hidden it was read

Copy link
Contributor Author

Choose a reason for hiding this comment

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

do I restore it?

Copy link
Contributor

Choose a reason for hiding this comment

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

we have to understand how to fix the problem. The card is a button so, when user goes on the card, the screen reader should read the content (i.e. the title and the subititle). The aria-hidden is to avoid that screen reader reads the content twice

Copy link
Collaborator

Choose a reason for hiding this comment

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

with aria-hidden the text 'A valore legale' and 'Di cortesia' are not read by windows voice assistant.

sx={{ mt: 0.5, mb: 1 }}
>
{t(title)}
</Typography>
<Typography
variant="body2"
data-testid="cardDescription"
aria-hidden
Copy link
Contributor

Choose a reason for hiding this comment

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

same as before

Copy link
Contributor Author

Choose a reason for hiding this comment

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

same as before

preloadedState: { userState: { user: userResponse } },
});
const title = getByRole('heading', { name: 'title' });
Copy link
Contributor

Choose a reason for hiding this comment

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

why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

test failure with that role

Copy link
Contributor

Choose a reason for hiding this comment

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

it is strange, this should not happen

Copy link
Contributor

@AndreaCimini90 AndreaCimini90 left a comment

Choose a reason for hiding this comment

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

Why did you use tabIndex in all this files? TabIndex should be used only on interactive element (read https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex#accessibility_concerns). So they should be removed

{getIcon()}
<Typography
variant="body2"
fontWeight={600}
data-testid="cardTitle"
aria-hidden
Copy link
Contributor

Choose a reason for hiding this comment

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

we have to understand how to fix the problem. The card is a button so, when user goes on the card, the screen reader should read the content (i.e. the title and the subititle). The aria-hidden is to avoid that screen reader reads the content twice

@AndreaCimini90 AndreaCimini90 deleted the fix/PN-12920 branch January 24, 2025 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants