Skip to content

Commit

Permalink
Fix issue with certain SECTION elements not being recognized as edita…
Browse files Browse the repository at this point in the history
…ble controls in Visual Studio Code (#17573)

closed #17525

Summary of the issue:
In Visual Studio Code, NVDA was unable to correctly read certain non-standard editable text controls, specifically those with the SECTION role that have an editable state. These controls could be edited by users but were not recognized as EDITABLETEXT by NVDA.

Description of user-facing changes:
This fix ensures that NVDA correctly recognizes and reads non-standard editable text controls, such as those with the SECTION role and an editable state, in Visual Studio Code.

Description of development approach:
In #16248, we introduced support for text-review commands for objects in Visual Studio Code. Initially, we used obj.role == controlTypes.Role.EDITABLETEXT as the check for editable text fields. However, this caused a regression for some controls, specifically SECTION elements in VS Code that were editable but did not have the EDITABLETEXT role. These controls have an editable state but were overlooked by NVDA. This fix updates the logic to account for such cases, ensuring these elements are treated as editable controls.
  • Loading branch information
cary-rowen authored Jan 9, 2025
1 parent bd45d8e commit e06f2b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
10 changes: 4 additions & 6 deletions source/appModules/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ def chooseNVDAObjectOverlayClasses(self, obj, clsList):
clsList.insert(0, VSCodeDocument)

def event_NVDAObject_init(self, obj: NVDAObject):
# This is a specific fix for Visual Studio Code,
# However, the root cause of the issue is issue #15159.
# Once issue #15159 is fixed,
# The PR #16248 that introduced this code can be immediately reverted.
# (see issue #15159 for full description)
if obj.role != controlTypes.Role.EDITABLETEXT:
# TODO: This is a specific fix for Visual Studio Code.
# Once the underlying issue is resolved, this workaround can be removed.
# See issue #15159 for more details.
if obj.role != controlTypes.Role.EDITABLETEXT and controlTypes.State.EDITABLE not in obj.states:
obj.TextInfo = NVDAObjectTextInfo
1 change: 1 addition & 0 deletions user_docs/en/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ In any document, if the cursor is on the last line, it will be moved to the end
* When the Standard HID Braille Display driver is explicitly selected as the braille display driver, and the braille display list is opened, NVDA correctly identifies the HID driver as the selected driver instead of showing no driver selected. (#17537, @LeonarddeR)
* The Humanware Brailliant driver is now more reliable in selecting the right connection endpoint, resulting in better connection stability and less errors. (#17537, @LeonarddeR)
* Custom braille tables in the developer scratchpad are now properly ignored when running with add-ons disabled. (#17565, @LeonarddeR)
* Fix issue with certain section elements not being recognized as editable controls in Visual Studio Code. (#17573, @Cary-rowen)

### Changes for Developers

Expand Down

0 comments on commit e06f2b8

Please sign in to comment.