Skip to content

Commit

Permalink
Ignore focus events generated by Switch Access focus actions
Browse files Browse the repository at this point in the history
When SA calls someAutomationNode.focus(), it may generate focus events on someAutomationNode later. This isn't always desirable, e.g. when the node is a text field and SA wants to remain on the VK.

Correct this by ignoring focus events of this type i.e. these events have eventFrom 'action'.

R=anastasi@google.com

Fixed: 1113669
AX-Relnotes: n/a
Change-Id: I2266f0aced57db1949dfad2793cc58ac2be923eb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2352613
Commit-Queue: David Tseng <dtseng@chromium.org>
Reviewed-by: Anastasia Helfinstein <anastasi@google.com>
Cr-Commit-Position: refs/heads/master@{#797836}
  • Loading branch information
dtsengchromium authored and Commit Bot committed Aug 13, 2020
1 parent ae606e4 commit 7b1e5a1
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,11 @@ class NavigationManager {
* @private
*/
onFocusChange_(event) {
// Ignore focus changes from our own actions.
if (event.eventFrom == 'action') {
return;
}

if (this.node_.isEquivalentTo(event.target)) {
return;
}
Expand Down

0 comments on commit 7b1e5a1

Please sign in to comment.