MS Word with UIA: Ensure braille is updated when typing text #13020
Conversation
LeonarddeR
left a comment
There was a problem hiding this comment.
I wonder whether this also fixes braille updates when working together in a document and the other party updates content on the line you're add. That would be a very nice side effect of this fix.
|
I just realised that this also applies to edit boxes in Visual Studio. We might want to generalize this to more instances of UIATextInfo. |
| def event_textChange(self): | ||
| # Ensure Braille is updated when text changes, | ||
| # As Microsoft Word does not fire caret events when typing text, even though the caret does move. | ||
| braille.handler.handleCaretMove(self) |
There was a problem hiding this comment.
Shouldn't we also trigger vision update here, so that if someone has caret highlighting enabled the correct character is highlighted?
I'd be happy to move this to UIA NVDAObject if you can confirm that these Visual Studio text fields used to work in 2021.2 (I.e. this is the same regression from #12868 ). |
|
There's definitely something broken but I can also reproduce it in older versions of NVDA. I will look into it. |
Link to issue number:
Fixes #12970
Fixes #13004
Regression caused by pr #12868
Summary of the issue:
When accessing an MS Word document via UIA, the braille display is not updated when typing characters into the document, although it does correctly update if the caret is moved with the arrow keys and such.
Generally, NVDA tells braille to update for each caret event. However, In Microsoft Word, although the caret does technically move when typing characters, Microsoft Word only fires a UIA textchange event (NVDA textChange event), and not a caret event (UIA textSelectionChanged event).
Before pr #12868 , Braille did seem to update correctly, but that was because NvDA was incorrectly passing an MSAA caret event into the UIA NVDAObject with focus.
Description of how this pull request fixes the issue:
On the MS Word document NVDAObject, implement an event_textChange method which just instructs Braille to update.
Testing strategy:
Known issues with pull request:
None known.
Change log entries:
None needed - regression was in 2021.3 dev cycle.
New features
Changes
Bug fixes
For Developers
Code Review Checklist: