-
Notifications
You must be signed in to change notification settings - Fork 7
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
Conversation
@@ -50,6 +50,7 @@ const TitleBox: React.FC<Props> = ({ | |||
variant={variantTitle} | |||
display="inline-block" | |||
sx={{ verticalAlign: 'middle' }} | |||
aria-label={`${title}-page`} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which is?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do I restore it?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as before
There was a problem hiding this comment.
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' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this change?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this 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 |
There was a problem hiding this comment.
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
Short description
fix a11y in ContactSummaryCard and TitleBoxComponent of contacts page for windows assistent
List of changes proposed in this pull request
How to test
with voiceOver/ Narrator navigate in previous component cited