Skip to content

Fix inaccurate text reporting in Visual Studio text controls#15838

Merged
seanbudd merged 4 commits into
nvaccess:masterfrom
LeonarddeR:wpfFix
Nov 28, 2023
Merged

Fix inaccurate text reporting in Visual Studio text controls#15838
seanbudd merged 4 commits into
nvaccess:masterfrom
LeonarddeR:wpfFix

Conversation

@LeonarddeR

@LeonarddeR LeonarddeR commented Nov 27, 2023

Copy link
Copy Markdown
Collaborator

Link to issue number:

follow up of #14888

Summary of the issue:

During development of #14888, it was observed that XAML edit fields tend to fire text change events before the caret position is changed, resulting in wrong text reporting. After using Visual Studio, I discovered that the same issue applies to the text controls in Visual Studio, notably WPF.

Description of user facing changes

In Visual Studio, the caret position is no longer sometimes reported inaccurately.

Description of development approach

use a common base class for XAML and WPF editable text.

Testing strategy:

Tested that caret reporting is again accurate in Visual Studio.

Known issues with pull request:

None known

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

@LeonarddeR LeonarddeR marked this pull request as ready for review November 27, 2023 10:53
@LeonarddeR LeonarddeR requested a review from a team as a code owner November 27, 2023 10:53
@seanbudd seanbudd added the conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. label Nov 27, 2023

@seanbudd seanbudd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @LeonarddeR

@seanbudd

Copy link
Copy Markdown
Member

Is this a regression fix? should there be a change log entry?

@LeonarddeR

LeonarddeR commented Nov 28, 2023 via email

Copy link
Copy Markdown
Collaborator Author

@seanbudd seanbudd merged commit 2190417 into nvaccess:master Nov 28, 2023
@nvaccessAuto nvaccessAuto added this to the 2024.1 milestone Nov 28, 2023
michaelDCurran added a commit that referenced this pull request Feb 14, 2024
seanbudd pushed a commit that referenced this pull request Jul 11, 2024
Partially reverts #14888, #15838

Summary of the issue:
In #14888, XamlEditableText was added to ensure that UIA events wouldn't be used to determine caret changes, as the hypothesis was that they were fired too early. In #15838, I expanded this workaround for WPF (Visual Studio) text controls.
It turns out @jcsteh found the actual cause of these issues and fixed them in #16711, allowing us to rely on events again.

Description of user facing changes
None, though caret movement would possibly be detected a little bit faster in XAML and WPF controls.

Description of development approach
Mostly reverts.
@LeonarddeR LeonarddeR deleted the wpfFix branch August 23, 2025 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants