[orca] Web: Handle caret-moved events preceding focus in spin buttons



commit b910e1a7d010eb21783eade4ebff2d7162b2d713
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Mon Sep 20 12:49:25 2021 +0200

    Web: Handle caret-moved events preceding focus in spin buttons
    
    Chrome (and possibly other browsers) emits caret-moved events prior to
    focus events with inputs. This can cause us to quietly set the focus
    and subsequently ignore the focus event. We were already handling that
    ordering for inputs exposed as entries. But inputs with a type of
    number get exposed as spin buttons. This commit fixes the issue for
    numeric inputs.

 src/orca/scripts/web/script.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/orca/scripts/web/script.py b/src/orca/scripts/web/script.py
index a64dc7b14..ccb0afcab 100644
--- a/src/orca/scripts/web/script.py
+++ b/src/orca/scripts/web/script.py
@@ -1646,7 +1646,7 @@ class Script(default.Script):
                 debug.println(debug.LEVEL_INFO, msg, True)
                 return True
 
-            if event.source.getRole() == pyatspi.ROLE_ENTRY \
+            if event.source.getRole() in [pyatspi.ROLE_ENTRY, pyatspi.ROLE_SPIN_BUTTON] \
                and event.source.getState().contains(pyatspi.STATE_FOCUSED) \
                and event.source != orca_state.locusOfFocus:
                 msg = "WEB: Event ignored: Entry is not (yet) the locus of focus. Waiting for focus event."


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]