i15653: better handle opening combo boxes in browse mode with automatically focus focusable elements disabled#16016
Conversation
…lements is not set, then delay the execution of the rest of the script to give time for the focus to move to the control.
… treated as part of the browse mode document.
seanbudd
previously approved these changes
Jan 9, 2024
Comment on lines
+57
to
+61
| parent = obj.parent | ||
| if parent and parent.role == controlTypes.Role.LIST: | ||
| parent = parent.parent | ||
| if parent and parent.role == controlTypes.Role.COMBOBOX: | ||
| return False |
Member
There was a problem hiding this comment.
Thoughts on this form? I think its easier to understand the structure of the controls like this.
Suggested change
| parent = obj.parent | |
| if parent and parent.role == controlTypes.Role.LIST: | |
| parent = parent.parent | |
| if parent and parent.role == controlTypes.Role.COMBOBOX: | |
| return False | |
| parent = obj.parent | |
| grandParent = parent.parent | |
| if ( | |
| parent | |
| and parent.role == controlTypes.Role.LIST | |
| and grandParent | |
| and grandParent.role == controlTypes.Role.COMBOBOX | |
| ): | |
| return False | |
Member
Author
There was a problem hiding this comment.
Agreed it is easier to parse, but it would be more costly, as you would be needlessly fetching grandparent in the vast majority of cases. And NvDAObject instantiation is not cheap. No doubt we could improve this, but right now that is the case.
Co-authored-by: Sean Budd <sean@nvaccess.org>
seanbudd
approved these changes
Jan 9, 2024
Adriani90
pushed a commit
to Adriani90/nvda
that referenced
this pull request
Mar 13, 2024
…ically focus focusable elements disabled (nvaccess#16016) Fixes nvaccess#15653 Summary of the issue: Two bugs are seen if automatically focus focus elements in browse mode is disabled. Possibly introduced when that setting was introduced, and made worse when browse mode focus code was further refacted in nvaccess#14611. In iTunes, arrowing up and down inside a combo box incorrectly switches back to browse mode. In Firefox / Chrome, closing a combo box does not automatically switch back to browse mode. Description of user facing changes NVDA will again switch back to browse mode when closing combo boxes with escape or alt+upArrow in Firefox or Chrome. (Action Items in iTunes not accessible nvaccess#15653) Arrowing up and down in combo boxes in iTunes will no longer inappropriately switch back to browse mode. (Action Items in iTunes not accessible nvaccess#15653) Description of development approach BrowseModeDocument's collapseOrExpandControl script: if automatic focus focusable elements is disabled, delay the rest of the script to give time for the control to actually get focus. Webkit (iTunes) virtualBuffer: do not treat the list items of a combo box as being part of the virtualBuffer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to issue number:
Fixes #15653
Summary of the issue:
Two bugs are seen if automatically focus focus elements in browse mode is disabled. Possibly introduced when that setting was introduced, and made worse when browse mode focus code was further refacted in #14611.
Description of user facing changes
Description of development approach
BrowseModeDocument's collapseOrExpandControl script: if automatic focus focusable elements is disabled, delay the rest of the script to give time for the control to actually get focus.
Testing strategy:
Known issues with pull request:
Code Review Checklist: