Skip to content

Work around pop over menu stealing focus in Ms Teams#11822

Merged
michaelDCurran merged 4 commits into
nvaccess:masterfrom
LeonarddeR:teamsPopOver
Nov 13, 2020
Merged

Work around pop over menu stealing focus in Ms Teams#11822
michaelDCurran merged 4 commits into
nvaccess:masterfrom
LeonarddeR:teamsPopOver

Conversation

@LeonarddeR

Copy link
Copy Markdown
Collaborator

Link to issue number:

closes #11821

Summary of the issue:

In the most recent version of Microsoft Teams, a pop over menu is displayed for every focused message, stealing focus from the message and making it difficult for users to read the message.

Description of how this pull request fixes the issue:

  1. Add a new shouldAllowIAccessibleMenuStartEvent property to IAccessible objects and check it before executing a focus event for SYSTEM_MENUSTART or SYSTEM_MENUPOPUPSTART.
  2. Add a Teams appmodule that adds this property to the obnoxious menus, setting it to False, thereby avoiding the menus stealing focus.

Testing performed:

Tested that the issue does no longer occur. Also tested that pressing enter on a message in Teams correctly focuses the first item in the menu.

Known issues with pull request:

Given JAWS and Narrator don't suffer from this issue, I think this should be considered a workaround and therefore we should consider looking into how menu start and menu popup start events are handling, trying to filter out the false positives earlier on.

Change log entry:

@akash07k

akash07k commented Nov 9, 2020

Copy link
Copy Markdown
Contributor

@LeonarddeR
Thanks a lot for this fix buddy.
If possible, can you please give me a try build?
I'm badly plagued by this bug.

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 6132c6c287

@LeonarddeR

Copy link
Copy Markdown
Collaborator Author

Here is a try build.

@LeonarddeR

Copy link
Copy Markdown
Collaborator Author

I believe the system test failure is unrelated to this work.

@akash07k

akash07k commented Nov 9, 2020

Copy link
Copy Markdown
Contributor

Thanks @LeonarddeR
It works.
No more that bug. able to read the messages properly now.

Here is a try build.

michaelDCurran
michaelDCurran previously approved these changes Nov 12, 2020

@michaelDCurran michaelDCurran left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks okay. I agree this is a work-around, but for Teams, not NVDA. It looks like each time a message gets focus, focus is then bownced by Teams to the menu which is not appropriate. Further to this, the items in the menu don't have any labels until pressing enter, when the menu becomes usable.

@michaelDCurran michaelDCurran merged commit 6af3083 into nvaccess:master Nov 13, 2020
@nvaccessAuto nvaccessAuto added this to the 2020.4 milestone Nov 13, 2020
@LeonarddeR

Copy link
Copy Markdown
Collaborator Author

It looks like each time a message gets focus, focus is then bownced by Teams to the menu which is not appropriate.

NVDA focuses the menu because of SYSTEM_MENUPOPUPSTART. Are you saying that this might be cause by teams focusing the menu explicitly and does chromium translate this to SYSTEM_MENUPOPUPSTART?
It would be interesting to know why other screen readers don't suffer from this.

Further to this, the items in the menu don't have any labels until pressing enter, when the menu becomes usable.

That's certainly a bug indeed.

@michaelDCurran

michaelDCurran commented Nov 15, 2020 via email

Copy link
Copy Markdown
Member

@LeonarddeR

Copy link
Copy Markdown
Collaborator Author

clearly when a message is focused, the menu is shown (though seems to contain no text so no doubt is invisible).

I don't think this is true. At least, I've heard reports from sighted people that the menu is visible.

@michaelDCurran

michaelDCurran commented Nov 16, 2020 via email

Copy link
Copy Markdown
Member

@feerrenrut

Copy link
Copy Markdown
Contributor

When focusing a message, visually there is a popup containing multiple emoji, and an overflow menu indicator (three dots). None of these are keyboard focusable until the enter key is pressed. It's pretty hard to guess how this is implemented, there are a lot of different ways it could be done.

michaelDCurran added a commit that referenced this pull request Nov 12, 2022
…on messages are focused. (#14363)

Fixes #14355
Broadens approach from pr #11822 which was to fix #11821.

Summary of the issue:
When a conversation message is focused in Microsoft Teams (E.g. arrowing up and down a threaded conversation list) Teams displays a reaction menu along side the focused message. As Chromium therefore fires a menu popupStart event, NVDA handles this by faking focus on the menu itself
This behaviour has been historically necessary for win32 context menus that fail to focus the first item in the menu.
However, In Teams this is very disruptive.

Description of user facing changes
NVDA will no longer get stuck in a menu when arrowing up and down threaded conversations in Microsoft Teams.

Description of development approach
Broaden the approach taken in pr #11821 by suppressing handling of menu popupStart for any element in teams with 'menu' in its xml-roles attribute. Previously NVDA would also check for very particular message container classes on the parent's parent. But as Teams keeps moving these, this is no longer managable.
@LeonarddeR LeonarddeR deleted the teamsPopOver branch August 23, 2025 06:28
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.

Microsoft Teams: Menu focused when trying to read a message

6 participants