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

Do not treat an avatar as a button if there is no menu #2883

Merged

Conversation

danxuliu
Copy link
Contributor

An avatar is treated as a button that toggles its contact menu, except when the menu was explicitly disabled. However, a menu may not be available even if it was not explicitly disabled (for example, if the avatar is for the current user). As no menu can be toggled in that case the avatar should not be treated as a button either.

Note that the menu is lazily loaded, so after you try to open the menu it could happen that there is actually no menu (that scenario can be tested by always returning a 404 in ContactsMenuController). In that case the avatar stops being a button after the user explicitly triggered it, is it needed to signal that to screen readers? Or maybe a toast should be shown in all cases, as even if you are not using a screen reader the behaviour is a bit strange. Opinions?

Another problem I noticed is that after focusing on an avatar and pressing enter to show the contact menu the focus is moved to the contact menu, but if shift-tab is used to go back to the avatar to close the menu the focus would move instead to another element (as the contact menu was appended to the end of the body). Is there any easy / quick way to solve that, or should I open a new issue?

How to test

  • Create a conversation in Talk
  • In the right sidebar, open the Participants tab
  • Add another participant
  • Click again on Search or add participants to focus it again
  • Press tab to focus the next element

Result with this pull request

The avatar of the other participant is focused. The avatar of the current user was skipped, as no interaction is possible.

Result without this pull request

The avatar of the current user is focused, even if no further interaction is possible

An avatar is treated as a button that toggles its contact menu, except
when the menu was explicitly disabled. However, a menu may not be
available even if it was not explicitly disabled (for example, if the
avatar is for the current user). As no menu can be toggled in that case
the avatar should not be treated as a button either.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
@danxuliu danxuliu added bug Something isn't working 3. to review Waiting for reviews feature: avatar Related to the avatar component accessibility Making sure we design for the widest range of people possible, including those who have disabilities labels Jul 24, 2022
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Copy link
Contributor

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

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

👍

@PVince81 PVince81 merged commit 1f5e098 into master Aug 4, 2022
@PVince81 PVince81 deleted the do-not-treat-an-avatar-as-a-button-if-there-is-no-menu branch August 4, 2022 20:41
@PVince81
Copy link
Contributor

PVince81 commented Aug 4, 2022

/backport to stable5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews accessibility Making sure we design for the widest range of people possible, including those who have disabilities bug Something isn't working feature: avatar Related to the avatar component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants